]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Re: PPP and shared zlib code in 2.5
authorCorey Minyard <cminyard@mvista.com>
Tue, 5 Mar 2002 07:02:25 +0000 (23:02 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Tue, 5 Mar 2002 07:02:25 +0000 (23:02 -0800)
Ok, I found it.  The problem was in the decompression code.

In inflate.c, in the routine zlib_inflate(), it reuses the passed-in "f"
parameter as a return value, but the PPP packet compression stuff needs
that return value later.

lib/zlib_inflate/inflate.c

index a7864316bf1ee4b316c390f4e3f59bca5fb50ea4..63e98aba21e6ef2bcbfe8a212bbc8dee0f04eb06 100644 (file)
@@ -117,12 +117,12 @@ int ZEXPORT zlib_inflate(z, f)
 z_streamp z;
 int f;
 {
-  int r;
+  int r, trv;
   uInt b;
 
   if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
     return Z_STREAM_ERROR;
-  f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
+  trv = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
   r = Z_BUF_ERROR;
   while (1) switch (z->state->mode)
   {
@@ -193,10 +193,10 @@ int f;
         break;
       }
       if (r == Z_OK)
-        r = f;
+        r = trv;
       if (r != Z_STREAM_END)
         return r;
-      r = f;
+      r = trv;
       zlib_inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
       if (z->state->nowrap)
       {