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

Bug#192765: apt-cache: Problem with checking return value from Tags.Scan() in DumpAvail()



Package: apt
Version: 0.5.5
Severity: grave
Tags: sid patch
Justification: causes non-serious data loss


Incorrect return value checking causes dselect to exit with error
message "E: Internal Error, Unable to parse a package record" after an
update is executed.

Trivial patch attached.


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux plugh 2.4.20-1-686 #1 Sat Mar 22 13:16:21 EST 2003 i686
Locale: LANG=C, LC_CTYPE=C

Versions of packages apt depends on:
ii  libc6                        2.3.1-17    GNU C Library: Shared libraries an
ii  libgcc1                      1:3.3-0pre9 GCC support library
ii  libstdc++5                   1:3.3-0pre9 The GNU Standard C++ Library v3

-- no debconf information

Index: apt-cache.cc
===================================================================
RCS file: /cvs/deity/apt/cmdline/apt-cache.cc,v
retrieving revision 1.63
diff -u -b -B -p -r1.63 apt-cache.cc
--- apt-cache.cc	27 Apr 2003 02:47:44 -0000	1.63
+++ apt-cache.cc	10 May 2003 08:16:25 -0000
@@ -481,7 +481,7 @@ bool DumpAvail(CommandLine &Cmd)
 	    pkgTagSection Tags;
 	    TFRewriteData RW[] = {{"Status",0},{"Config-Version",0},{}};
 	    const char *Zero = 0;
-	    if (Tags.Scan(Buffer+Jitter,VF.Size+1) == false ||
+	    if (Tags.Scan(Buffer+Jitter,VF.Size+1) != pkgTagSection::ScanSuccess ||
 		TFRewrite(stdout,Tags,&Zero,RW) == false)
 	    {
 	       _error->Error("Internal Error, Unable to parse a package record");

Reply to: