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

Re: Bug#81881: dpkg: cannot unpack packages on Linux 2.2.0 to 2.2.10



tags 81881 patch
thanks

The following patch will fix the problem.  The strace was very helpful in
figuring out exactly what the code path was(this means I've looked at too many
dpkg straces, bleh).

I'll be checking this into HEAD and the 1.8 branch when I get home tonight,
and making an upload.

Index: lib/mlib.c
===================================================================
RCS file: /cvs/dpkg/dpkg/lib/mlib.c,v
retrieving revision 1.15
diff -u -r1.15 mlib.c
--- lib/mlib.c  2001/01/04 07:35:21     1.15
+++ lib/mlib.c  2001/01/11 01:20:40
@@ -266,7 +266,7 @@
   writebuf= buf= malloc(bufsize);
   if(buf== NULL) ohshite(_("failed to allocate buffer in buffer_copy (%s)"),
desc);
 
-  while(bytesread >= 0 && byteswritten >= 0) {
+  while(bytesread >= 0 && byteswritten >= 0 && bufsize > 0) {
     bytesread= read_data->proc(read_data, buf, bufsize, desc);
     if (bytesread<0) {
       if (errno==EINTR) continue;

----BEGIN GEEK CODE BLOCK----
Version: 3.12
GCS d- s: a-- c+++ UL++++ P+ L++++ !E W+ M o+ K- W--- !O M- !V PS--
PE++ Y+ PGP++ t* 5++ X+ tv b+ D++ G e h*! !r z?
-----END GEEK CODE BLOCK-----
----BEGIN PGP INFO----
Adam Heath <doogie@debian.org>        Finger Print | KeyID
67 01 42 93 CA 37 FB 1E    63 C9 80 1D 08 CF 84 0A | DE656B05 PGP
AD46 C888 F587 F8A3 A6DA  3261 8A2C 7DC2 8BD4 A489 | 8BD4A489 GPG
-----END PGP INFO-----

ps: This should also happen on some 2.1 kernels.



Reply to: