From: Rolf K. <lab...@us...> - 2004-12-08 20:23:59
|
Update of /cvsroot/opengtoolkit/lvzip/c_source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11126/c_source Modified Files: ChangeLog ChangeLogUnzip FAQ INDEX adler32.c compress.c crc32.c crypt.h deflate.c deflate.h example.c gzio.c infback.c inffast.c inflate.c inftrees.c ioapi.c ioapi.h Log Message: Updated zlib library to version 1.2.2 and zip/unzip to 1.01d Index: ioapi.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/ioapi.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ioapi.h 7 Dec 2004 22:52:50 -0000 1.3 --- ioapi.h 8 Dec 2004 20:23:39 -0000 1.4 *************** *** 2,8 **** files using zlib + zip or unzip API ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant */ --- 2,8 ---- files using zlib + zip or unzip API ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant */ Index: FAQ =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/FAQ,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FAQ 7 Dec 2004 22:52:50 -0000 1.2 --- FAQ 8 Dec 2004 20:23:39 -0000 1.3 *************** *** 22,30 **** See - * http://www.winimage.com/zLibDll/ * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm * contrib/visual-basic.txt in the zlib distribution ! 4. compress() returns Z_BUF_ERROR Make sure that before the call of compress, the length of the compressed --- 22,30 ---- See * http://www.dogma.net/markn/articles/zlibtool/zlibtool.htm * contrib/visual-basic.txt in the zlib distribution + * win32/DLL_FAQ.txt in the zlib distribution ! 4. compress() returns Z_BUF_ERROR. Make sure that before the call of compress, the length of the compressed *************** *** 33,37 **** ("as any"), not by value ("as long"). ! 5. deflate() or inflate() returns Z_BUF_ERROR Before making the call, make sure that avail_in and avail_out are not --- 33,37 ---- ("as any"), not by value ("as long"). ! 5. deflate() or inflate() returns Z_BUF_ERROR. Before making the call, make sure that avail_in and avail_out are not *************** *** 48,53 **** It's in zlib.h for the moment, and Francis S. Lin has converted it to a web page zlib.html. Volunteers to transform this to Unix-style man pages, ! please contact Jean-loup Gailly (jl...@gz...). Examples of zlib usage ! are in the files example.c and minigzip.c. 7. Why don't you use GNU autoconf or libtool or ...? --- 48,53 ---- It's in zlib.h for the moment, and Francis S. Lin has converted it to a web page zlib.html. Volunteers to transform this to Unix-style man pages, ! please contact us (zl...@gz...). Examples of zlib usage are in the files ! example.c and minigzip.c. 7. Why don't you use GNU autoconf or libtool or ...? *************** *** 78,82 **** 11. Can zlib handle .zip archives? ! See the directory contrib/minizip in the zlib distribution. 12. Can zlib handle .Z files? --- 78,83 ---- 11. Can zlib handle .zip archives? ! Not by itself, no. See the directory contrib/minizip in the zlib ! distribution. 12. Can zlib handle .Z files? *************** *** 93,96 **** --- 94,99 ---- 14. How do I install a shared zlib library on Unix? + After the above, then: + make install *************** *** 100,109 **** can #include <zlib.h>, it's there. The -lz option will probably link to it. ! 15. I have a question about OttoPDF We are not the authors of OttoPDF. The real author is on the OttoPDF web ! site Joel Hainley jha...@my.... ! 16. Why does gzip give an error on a file I make with compress/deflate? The compress and deflate functions produce data in the zlib format, which --- 103,131 ---- can #include <zlib.h>, it's there. The -lz option will probably link to it. ! 15. I have a question about OttoPDF. We are not the authors of OttoPDF. The real author is on the OttoPDF web ! site: Joel Hainley, jha...@my.... ! 16. Can zlib decode Flate data in an Adobe PDF file? ! ! Yes. See http://www.fastio.com/ (ClibPDF), or http://www.pdflib.com/ . ! To modify PDF forms, see http://sourceforge.net/projects/acroformtool/ . ! ! 17. Why am I getting this "register_frame_info not found" error on Solaris? ! ! After installing zlib 1.1.4 on Solaris 2.6, running applications using zlib ! generates an error such as: ! ! ld.so.1: rpm: fatal: relocation error: file /usr/local/lib/libz.so: ! symbol __register_frame_info: referenced symbol not found ! ! The symbol __register_frame_info is not part of zlib, it is generated by ! the C compiler (cc or gcc). You must recompile applications using zlib ! which have this problem. This problem is specific to Solaris. See ! http://www.sunfreeware.com for Solaris versions of zlib and applications ! using zlib. ! ! 18. Why does gzip give an error on a file I make with compress/deflate? The compress and deflate functions produce data in the zlib format, which *************** *** 113,117 **** headers and trailers around the compressed data. ! 17. Ok, so why are there two different formats? The gzip format was designed to retain the directory information about --- 135,139 ---- headers and trailers around the compressed data. ! 19. Ok, so why are there two different formats? The gzip format was designed to retain the directory information about *************** *** 121,125 **** uses a faster integrity check than gzip. ! 18. Well that's nice, but how do I make a gzip file in memory? You can request that deflate write the gzip format instead of the zlib --- 143,147 ---- uses a faster integrity check than gzip. ! 20. Well that's nice, but how do I make a gzip file in memory? You can request that deflate write the gzip format instead of the zlib *************** *** 134,138 **** RFC 1952 for details of the header and trailer format. ! 19. Is zlib thread-safe? Yes. However any library routines that zlib uses and any application- --- 156,160 ---- RFC 1952 for details of the header and trailer format. ! 21. Is zlib thread-safe? Yes. However any library routines that zlib uses and any application- *************** *** 145,157 **** single thread at a time. ! 20. Can I use zlib in my commercial application? Yes. Please read the license in zlib.h. ! 21. Is zlib under the GNU license? No. Please read the license in zlib.h. ! 22. The license says that altered source versions must be "plainly marked". So what exactly do I need to do to meet that requirement? --- 167,179 ---- single thread at a time. ! 22. Can I use zlib in my commercial application? Yes. Please read the license in zlib.h. ! 23. Is zlib under the GNU license? No. Please read the license in zlib.h. ! 24. The license says that altered source versions must be "plainly marked". So what exactly do I need to do to meet that requirement? *************** *** 176,185 **** in zlib.h as you would for a full source distribution. ! 23. Will zlib work on a big-endian or little-endian architecture, and can I exchange compressed data between them? Yes and yes. ! 24. Will zlib work on a 64-bit machine? It should. It has been tested on 64-bit machines, and has no dependence --- 198,207 ---- in zlib.h as you would for a full source distribution. ! 25. Will zlib work on a big-endian or little-endian architecture, and can I exchange compressed data between them? Yes and yes. ! 26. Will zlib work on a 64-bit machine? It should. It has been tested on 64-bit machines, and has no dependence *************** *** 187,191 **** difficulties, please provide a complete problem report to zl...@gz... ! 25. Will zlib decompress data from the PKWare Data Compression Library? No. The PKWare DCL uses a completely different compressed data format --- 209,213 ---- difficulties, please provide a complete problem report to zl...@gz... ! 27. Will zlib decompress data from the PKWare Data Compression Library? No. The PKWare DCL uses a completely different compressed data format *************** *** 193,197 **** directory for a possible solution to your problem. ! 26. Can I access data randomly in a compressed stream? No, not without some preparation. If when compressing you periodically --- 215,219 ---- directory for a possible solution to your problem. ! 28. Can I access data randomly in a compressed stream? No, not without some preparation. If when compressing you periodically *************** *** 201,205 **** often, since it can significantly degrade compression. ! 27. Does zlib work on MVS, OS/390, CICS, etc.? We don't know for sure. We have heard occasional reports of success on --- 223,227 ---- often, since it can significantly degrade compression. ! 29. Does zlib work on MVS, OS/390, CICS, etc.? We don't know for sure. We have heard occasional reports of success on *************** *** 208,212 **** these questions. Thanks. ! 28. Is there some simpler, easier to read version of inflate I can look at to understand the deflate format? --- 230,234 ---- these questions. Thanks. ! 30. Is there some simpler, easier to read version of inflate I can look at to understand the deflate format? *************** *** 214,218 **** contrib/puff directory. ! 29. Does zlib infringe on any patents? As far as we know, no. In fact, that was originally the whole point behind --- 236,240 ---- contrib/puff directory. ! 31. Does zlib infringe on any patents? As far as we know, no. In fact, that was originally the whole point behind *************** *** 221,225 **** http://www.gzip.org/#faq11 ! 30. Can zlib work with greater than 4 GB of data? Yes. inflate() and deflate() will process any amount of data correctly. --- 243,247 ---- http://www.gzip.org/#faq11 ! 32. Can zlib work with greater than 4 GB of data? Yes. inflate() and deflate() will process any amount of data correctly. *************** *** 239,243 **** type is 64 bits, then the limit is 16 exabytes. ! 31. Does zlib have any security vulnerabilities? The only one that we are aware of is potentially in gzprintf(). If zlib --- 261,265 ---- type is 64 bits, then the limit is 16 exabytes. ! 33. Does zlib have any security vulnerabilities? The only one that we are aware of is potentially in gzprintf(). If zlib *************** *** 259,263 **** 1.1.3 and before were subject to a double-free vulnerability. ! 32. Is there a Java version of zlib? Probably what you want is to use zlib in Java. zlib is already included --- 281,285 ---- 1.1.3 and before were subject to a double-free vulnerability. ! 34. Is there a Java version of zlib? Probably what you want is to use zlib in Java. zlib is already included *************** *** 266,271 **** page for links: http://www.zlib.org/ ! 33. I get this or that compiler or source-code scanner warning when I crank it ! up to maximally-pendantic. Can't you guys write proper code? Many years ago, we gave up attempting to avoid warnings on every compiler --- 288,293 ---- page for links: http://www.zlib.org/ ! 35. I get this or that compiler or source-code scanner warning when I crank it ! up to maximally-pedantic. Can't you guys write proper code? Many years ago, we gave up attempting to avoid warnings on every compiler *************** *** 274,278 **** works. ! 34. Will zlib read the (insert any ancient or arcane format here) compressed data format? --- 296,300 ---- works. ! 36. Will zlib read the (insert any ancient or arcane format here) compressed data format? *************** *** 280,291 **** formats and associated software. ! 35. How can I encrypt/decrypt zip files with zlib? zlib doesn't support encryption. The original PKZIP encryption is very weak and can be broken with freely available programs. To get strong encryption, ! use gpg ( http://www.gnupg.org/ ) which already includes zlib compression. For PKZIP compatible "encryption", look at http://www.info-zip.org/ ! 36. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? "gzip" is the gzip format, and "deflate" is the zlib format. They should --- 302,313 ---- formats and associated software. ! 37. How can I encrypt/decrypt zip files with zlib? zlib doesn't support encryption. The original PKZIP encryption is very weak and can be broken with freely available programs. To get strong encryption, ! use GnuPG, http://www.gnupg.org/ , which already includes zlib compression. For PKZIP compatible "encryption", look at http://www.info-zip.org/ ! 38. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? "gzip" is the gzip format, and "deflate" is the zlib format. They should *************** *** 303,307 **** Bottom line: use the gzip format for HTTP 1.1 encoding. ! 37. Does zlib support the new "Deflate64" format introduced by PKWare? No. PKWare has apparently decided to keep that format proprietary, since --- 325,329 ---- Bottom line: use the gzip format for HTTP 1.1 encoding. ! 39. Does zlib support the new "Deflate64" format introduced by PKWare? No. PKWare has apparently decided to keep that format proprietary, since *************** *** 310,314 **** more modern approaches, that it's not worth the effort to implement. ! 38. Can you please sign these lengthy legal documents and fax them back to us so that we can use your software in our product? --- 332,336 ---- more modern approaches, that it's not worth the effort to implement. ! 40. Can you please sign these lengthy legal documents and fax them back to us so that we can use your software in our product? Index: ChangeLogUnzip =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/ChangeLogUnzip,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ChangeLogUnzip 4 Oct 2002 09:41:32 -0000 1.1 --- ChangeLogUnzip 8 Dec 2004 20:23:39 -0000 1.2 *************** *** 1,2 **** --- 1,27 ---- + Change in 1.01b (20 may 04) + - Integrate patch from Debian package (submited by Mark Brown) + - Add tools mztools from Xavier Roche + + Change in 1.01 (8 may 04) + - fix buffer overrun risk in unzip.c (Xavier Roche) + - fix a minor buffer insecurity in minizip.c (Mike Whittaker) + + Change in 1.00: (10 sept 03) + - rename to 1.00 + - cosmetic code change + + Change in 0.22: (19 May 03) + - crypting support (unless you define NOCRYPT) + - append file in existing zipfile + + Change in 0.21: (10 Mar 03) + - bug fixes + + Change in 0.17: (27 Jan 02) + - bug fixes + + Change in 0.16: (19 Jan 02) + - Support of ioapi for virtualize zip file access + Change in 0.15: (19 Mar 98) - fix memory leak in minizip.c *************** *** 5,9 **** - fix bugs in minizip.c sample for zipping big file - fix problem in month in date handling ! - fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for comment handling --- 30,34 ---- - fix bugs in minizip.c sample for zipping big file - fix problem in month in date handling ! - fix bug in unzlocal_GetCurrentFileInfoInternal in unzip.c for comment handling *************** *** 33,37 **** Change in 0.4: (25 Feb 98) ! - suppress the type unzipFileInZip. Only on file in the zipfile can be open at the same time - fix somes typo in code --- 58,62 ---- Change in 0.4: (25 Feb 98) ! - suppress the type unzipFileInZip. Only on file in the zipfile can be open at the same time - fix somes typo in code Index: inflate.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/inflate.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** inflate.c 7 Dec 2004 22:52:50 -0000 1.2 --- inflate.c 8 Dec 2004 20:23:39 -0000 1.3 *************** *** 110,113 **** --- 110,114 ---- strm->total_in = strm->total_out = state->total = 0; strm->msg = Z_NULL; + strm->adler = 1; /* to support ill-conceived Java test suite */ state->mode = HEAD; state->last = 0; *************** *** 862,865 **** --- 863,869 ---- } + /* handle error breaks in while */ + if (state->mode == BAD) break; + /* build code tables */ state->next = state->codes; Index: INDEX =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/INDEX,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** INDEX 7 Dec 2004 22:52:50 -0000 1.2 --- INDEX 8 Dec 2004 20:23:39 -0000 1.3 *************** *** 9,15 **** --- 9,18 ---- zconf.in.h template for zconf.h (used by configure) + amiga/ makefiles for Amiga SAS C + as400/ makefiles for IBM AS/400 msdos/ makefiles for MSDOS old/ makefiles for various architectures and zlib documentation files that have not yet been updated for zlib 1.2.x + projects/ projects for various Integrated Development Environments qnx/ makefiles for QNX win32/ makefiles for Windows Index: ChangeLog =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ChangeLog 7 Dec 2004 22:52:49 -0000 1.4 --- ChangeLog 8 Dec 2004 20:23:39 -0000 1.5 *************** *** 2,9 **** ChangeLog file for zlib ! Changes in 1.2.1.LV3 (17 November 2004) ! - Added the 1.00, September 10th, 2003 version of zip and unzip from Gilles Vollant to the library. Changes in 1.2.1 (17 November 2003) - Remove a tab in contrib/gzappend/gzappend.c --- 2,51 ---- ChangeLog file for zlib ! Changes in 1.2.2.LV3 (17 November 2004) ! - Added the 1.01d, October, 2003 version of zip and unzip from Gilles Vollant to the library. + Changes in 1.2.2 (3 October 2004) + - Update zlib.h comments on gzip in-memory processing + - Set adler to 1 in inflateReset() to support Java test suite [Walles] + - Add contrib/dotzlib [Ravn] + - Update win32/DLL_FAQ.txt [Truta] + - Update contrib/minizip [Vollant] + - Move contrib/visual-basic.txt to old/ [Truta] + - Fix assembler builds in projects/visualc6/ [Truta] + + Changes in 1.2.1.2 (9 September 2004) + - Update INDEX file + - Fix trees.c to update strm->data_type (no one ever noticed!) + - Fix bug in error case in inflate.c, infback.c, and infback9.c [Brown] + - Add "volatile" to crc table flag declaration (for DYNAMIC_CRC_TABLE) + - Add limited multitasking protection to DYNAMIC_CRC_TABLE + - Add NO_vsnprintf for VMS in zutil.h [Mozilla] + - Don't declare strerror() under VMS [Mozilla] + - Add comment to DYNAMIC_CRC_TABLE to use get_crc_table() to initialize + - Update contrib/ada [Anisimkov] + - Update contrib/minizip [Vollant] + - Fix configure to not hardcode directories for Darwin [Peterson] + - Fix gzio.c to not return error on empty files [Brown] + - Fix indentation; update version in contrib/delphi/ZLib.pas and + contrib/pascal/zlibpas.pas [Truta] + - Update mkasm.bat in contrib/masmx86 [Truta] + - Update contrib/untgz [Truta] + - Add projects/README.projects [Truta] + - Add project for MS Visual C++ 6.0 in projects/visualc6 [Cadieux, Truta] + - Update win32/DLL_FAQ.txt [Truta] + - Update list of Z_PREFIX symbols in zconf.h [Randers-Pehrson, Truta] + - Remove an unnecessary assignment to curr in inftrees.c [Truta] + - Add OS/2 to exe builds in configure [Poltorak] + - Remove err dummy parameter in zlib.h [Kientzle] + + Changes in 1.2.1.1 (9 January 2004) + - Update email address in README + - Several FAQ updates + - Fix a big fat bug in inftrees.c that prevented decoding valid + dynamic blocks with only literals and no distance codes -- + Thanks to "Hot Emu" for the bug report and sample file + - Add a note to puff.c on no distance codes case. + Changes in 1.2.1 (17 November 2003) - Remove a tab in contrib/gzappend/gzappend.c Index: ioapi.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/ioapi.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ioapi.c 7 Dec 2004 22:52:50 -0000 1.3 --- ioapi.c 8 Dec 2004 20:23:39 -0000 1.4 *************** *** 2,8 **** files using zlib + zip or unzip API ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant */ --- 2,8 ---- files using zlib + zip or unzip API ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant */ *************** *** 95,99 **** { uLong ret; ! ret = fread(buf, 1, (size_t)size, (FILE *)stream); return ret; } --- 95,99 ---- { uLong ret; ! ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); return ret; } *************** *** 107,111 **** { uLong ret; ! ret = fwrite(buf, 1, (size_t)size, (FILE *)stream); return ret; } --- 107,111 ---- { uLong ret; ! ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); return ret; } Index: inffast.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/inffast.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** inffast.c 7 Dec 2004 22:52:50 -0000 1.2 --- inffast.c 8 Dec 2004 20:23:39 -0000 1.3 *************** *** 1,4 **** /* inffast.c -- fast decoding ! * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* inffast.c -- fast decoding ! * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 20,24 **** No measurable difference: - Pentium III (Anderson) ! - 68060 (Nikl) */ #ifdef POSTINC --- 20,24 ---- No measurable difference: - Pentium III (Anderson) ! - M68060 (Nikl) */ #ifdef POSTINC Index: inftrees.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/inftrees.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** inftrees.c 7 Dec 2004 22:52:50 -0000 1.2 --- inftrees.c 8 Dec 2004 20:23:39 -0000 1.3 *************** *** 1,4 **** /* inftrees.c -- generate Huffman trees for efficient decoding ! * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* inftrees.c -- generate Huffman trees for efficient decoding ! * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 10,14 **** const char inflate_copyright[] = ! " inflate 1.2.1 Copyright 1995-2003 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome --- 10,14 ---- const char inflate_copyright[] = ! " inflate 1.2.2 Copyright 1995-2004 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome *************** *** 63,67 **** static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, ! 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 76, 66}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, --- 63,67 ---- static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, ! 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 198}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, *************** *** 115,119 **** if (count[max] != 0) break; if (root > max) root = max; ! if (max == 0) return -1; /* no codes! */ for (min = 1; min <= MAXBITS; min++) if (count[min] != 0) break; --- 115,127 ---- if (count[max] != 0) break; if (root > max) root = max; ! if (max == 0) { /* no symbols to code at all */ ! this.op = (unsigned char)64; /* invalid code marker */ ! this.bits = (unsigned char)1; ! this.val = (unsigned short)0; ! *(*table)++ = this; /* make a table to force an error */ ! *(*table)++ = this; ! *bits = 1; ! return 0; /* no symbols, but wait for decoding to report error */ ! } for (min = 1; min <= MAXBITS; min++) if (count[min] != 0) break; *************** *** 296,300 **** len = root; next = *table; - curr = root; this.bits = (unsigned char)len; } --- 304,307 ---- Index: gzio.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/gzio.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gzio.c 7 Dec 2004 22:52:50 -0000 1.2 --- gzio.c 8 Dec 2004 20:23:39 -0000 1.3 *************** *** 456,459 **** --- 456,463 ---- break; } + if (feof(s->file)) { /* avoid error for empty file */ + s->z_err = Z_STREAM_END; + break; + } } s->stream.next_in = s->inbuf; Index: crypt.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/crypt.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** crypt.h 7 Dec 2004 22:52:50 -0000 1.1 --- crypt.h 8 Dec 2004 20:23:39 -0000 1.2 *************** *** 2,8 **** ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant This code is a modified version of crypting code in Infozip distribution --- 2,8 ---- ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant This code is a modified version of crypting code in Infozip distribution Index: infback.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/infback.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** infback.c 7 Dec 2004 22:52:50 -0000 1.1 --- infback.c 8 Dec 2004 20:23:39 -0000 1.2 *************** *** 435,438 **** --- 435,441 ---- } + /* handle error breaks in while */ + if (state->mode == BAD) break; + /* build code tables */ state->next = state->codes; Index: deflate.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/deflate.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** deflate.c 7 Dec 2004 22:52:50 -0000 1.2 --- deflate.c 8 Dec 2004 20:23:39 -0000 1.3 *************** *** 1,4 **** /* deflate.c -- compress data using the deflation algorithm ! * Copyright (C) 1995-2003 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* deflate.c -- compress data using the deflation algorithm ! * Copyright (C) 1995-2004 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 53,57 **** const char deflate_copyright[] = ! " deflate 1.2.1 Copyright 1995-2003 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome --- 53,57 ---- const char deflate_copyright[] = ! " deflate 1.2.2 Copyright 1995-2004 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome Index: crc32.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/crc32.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** crc32.c 7 Dec 2004 22:52:50 -0000 1.2 --- crc32.c 8 Dec 2004 20:23:39 -0000 1.3 *************** *** 12,15 **** --- 12,23 ---- /* @(#) $Id$ */ + /* + Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore + protection on the static variables used to control the first-use generation + of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should + first call get_crc_table() to initialize the tables before allowing more than + one thread to use crc32(). + */ + #ifdef MAKECRCH # include <stdio.h> *************** *** 59,63 **** #ifdef DYNAMIC_CRC_TABLE ! local int crc_table_empty = 1; local unsigned long FAR crc_table[TBLS][256]; local void make_crc_table OF((void)); --- 67,71 ---- #ifdef DYNAMIC_CRC_TABLE ! local volatile int crc_table_empty = 1; local unsigned long FAR crc_table[TBLS][256]; local void make_crc_table OF((void)); *************** *** 96,131 **** unsigned long c; int n, k; ! unsigned long poly; /* polynomial exclusive-or pattern */ /* terms of polynomial defining this crc (except x^32): */ static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; ! /* make exclusive-or pattern from polynomial (0xedb88320UL) */ ! poly = 0UL; ! for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) ! poly |= 1UL << (31 - p[n]); ! /* generate a crc for every 8-bit value */ ! for (n = 0; n < 256; n++) { ! c = (unsigned long)n; ! for (k = 0; k < 8; k++) ! c = c & 1 ? poly ^ (c >> 1) : c >> 1; ! crc_table[0][n] = c; ! } #ifdef BYFOUR ! /* generate crc for each value followed by one, two, and three zeros, and ! then the byte reversal of those as well as the first table */ ! for (n = 0; n < 256; n++) { ! c = crc_table[0][n]; ! crc_table[4][n] = REV(c); ! for (k = 1; k < 4; k++) { ! c = crc_table[0][c & 0xff] ^ (c >> 8); ! crc_table[k][n] = c; ! crc_table[k + 4][n] = REV(c); } - } #endif /* BYFOUR */ ! crc_table_empty = 0; #ifdef MAKECRCH --- 104,152 ---- unsigned long c; int n, k; ! unsigned long poly; /* polynomial exclusive-or pattern */ /* terms of polynomial defining this crc (except x^32): */ + static volatile int first = 1; /* flag to limit concurrent making */ static const unsigned char p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; ! /* See if another task is already doing this (not thread-safe, but better ! than nothing -- significantly reduces duration of vulnerability in ! case the advice about DYNAMIC_CRC_TABLE is ignored) */ ! if (first) { ! first = 0; ! /* make exclusive-or pattern from polynomial (0xedb88320UL) */ ! poly = 0UL; ! for (n = 0; n < sizeof(p)/sizeof(unsigned char); n++) ! poly |= 1UL << (31 - p[n]); ! ! /* generate a crc for every 8-bit value */ ! for (n = 0; n < 256; n++) { ! c = (unsigned long)n; ! for (k = 0; k < 8; k++) ! c = c & 1 ? poly ^ (c >> 1) : c >> 1; ! crc_table[0][n] = c; ! } #ifdef BYFOUR ! /* generate crc for each value followed by one, two, and three zeros, ! and then the byte reversal of those as well as the first table */ ! for (n = 0; n < 256; n++) { ! c = crc_table[0][n]; ! crc_table[4][n] = REV(c); ! for (k = 1; k < 4; k++) { ! c = crc_table[0][c & 0xff] ^ (c >> 8); ! crc_table[k][n] = c; ! crc_table[k + 4][n] = REV(c); ! } } #endif /* BYFOUR */ ! crc_table_empty = 0; ! } ! else { /* not first */ ! /* wait for the other guy to finish (not efficient, but rare) */ ! while (crc_table_empty) ! ; ! } #ifdef MAKECRCH *************** *** 181,187 **** { #ifdef DYNAMIC_CRC_TABLE ! if (crc_table_empty) make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ ! return (const unsigned long FAR *)crc_table; } --- 202,209 ---- { #ifdef DYNAMIC_CRC_TABLE ! if (crc_table_empty) ! make_crc_table(); #endif /* DYNAMIC_CRC_TABLE */ ! return (const unsigned long FAR *)crc_table; } Index: deflate.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/deflate.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** deflate.h 7 Dec 2004 22:52:50 -0000 1.2 --- deflate.h 8 Dec 2004 20:23:39 -0000 1.3 *************** *** 96,100 **** int pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - Byte data_type; /* UNKNOWN, BINARY or ASCII */ Byte method; /* STORED (for zip only) or DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ --- 96,99 ---- |