File zlib-1.2.1.2-can-2005-2096.patch of Package zlib-1.2.1.2

Permit incomplete codes only if they consist of a single code of length 1.
--- zlib-1.2.1.2/inftrees.c.incomplete-set	2004-09-07 07:29:19.000000000 +0200
+++ zlib-1.2.1.2/inftrees.c	2005-07-04 11:59:07.000000000 +0200
@@ -134,7 +134,7 @@
         left -= count[len];
         if (left < 0) return -1;        /* over-subscribed */
     }
-    if (left > 0 && (type == CODES || (codes - count[0] != 1)))
+    if (left > 0 && (type == CODES || max != 1))
         return -1;                      /* incomplete set */
 
     /* generate offsets into symbol table for each length for sorting */
openSUSE Build Service is sponsored by