[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#203483: apt: chokes on a good /var/lib/dpkg/status



Package: apt
Version: 0.5.4
Severity: grave
Justification: renders package unusable
Tags: patch

Hi,

apt-get continued to error out stating it could not parse
/var/lib/dpkg/status:

     Unable to parse package file /var/lib/dpkg/status (1)

but I went over /var/lib/dpkg/status and could not find anything
amiss. So I checked the source code and noticed that at the
end of the file, the buffer was reset and had zero data in it
which caused Tag.Scan() to return false. (See tagfile.cc:70).
But this is an error because the code should have already
determined it was at the end of the file and *not* call
Tag.Scan() a second time.

*** tagfile.cc~	Mon May 14 00:56:26 2001
--- tagfile.cc	Wed Jul 30 05:36:05 2003
*************** bool pkgTagFile::Fill()
*** 112,119 ****
     unsigned long Actual;
     if (Fd.Read(End,Size - (End - Buffer),&Actual) == false)
        return false;
!    if (Actual != Size - (End - Buffer))
        Done = true;
     End += Actual;
  /*   
     if (Left < Size - (End - Buffer))
--- 112,121 ----
     unsigned long Actual;
     if (Fd.Read(End,Size - (End - Buffer),&Actual) == false)
        return false;
!    if (Actual != Size - (End - Buffer)) {
        Done = true;
+       return false;
+    }
     End += Actual;
  /*   
     if (Left < Size - (End - Buffer))


-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux miller 2.2.20-idepci #1 Sat Apr 20 12:45:19 EST 2002 i486
Locale: LANG=C, LC_CTYPE=C

Versions of packages apt depends on:
ii  libc6                  2.2.5-11.5        GNU C Library: Shared libraries an
ii  libstdc++2.10-glibc2.2 1:2.95.4-11woody1 The GNU stdc++ library



Reply to: