diff -r -c zl1211orig/contrib/minizip/ChangeLogUnzip zl1211gvpatched/contrib/minizip/ChangeLogUnzip *** zl1211orig/contrib/minizip/ChangeLogUnzip Wed Sep 10 10:00:15 2003 --- zl1211gvpatched/contrib/minizip/ChangeLogUnzip Sun May 30 16:27:11 2004 *************** *** 1,3 **** --- 1,11 ---- + 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 diff -r -c zl1211orig/contrib/minizip/crypt.h zl1211gvpatched/contrib/minizip/crypt.h *** zl1211orig/contrib/minizip/crypt.h Wed Sep 10 10:00:15 2003 --- zl1211gvpatched/contrib/minizip/crypt.h Sun May 16 13:17:11 2004 *************** *** 1,9 **** /* crypt.h -- base code for crypt/uncrypt ZIPfile ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant This code is a modified version of crypting code in Infozip distribution --- 1,9 ---- /* crypt.h -- base code for crypt/uncrypt ZIPfile ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant This code is a modified version of crypting code in Infozip distribution diff -r -c zl1211orig/contrib/minizip/ioapi.c zl1211gvpatched/contrib/minizip/ioapi.c *** zl1211orig/contrib/minizip/ioapi.c Wed Sep 10 10:00:15 2003 --- zl1211gvpatched/contrib/minizip/ioapi.c Sun May 16 13:36:57 2004 *************** *** 1,9 **** /* ioapi.c -- IO base function header for compress/uncompress .zip files using zlib + zip or unzip API ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant */ #include --- 1,9 ---- /* ioapi.c -- IO base function header for compress/uncompress .zip files using zlib + zip or unzip API ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant */ #include diff -r -c zl1211orig/contrib/minizip/ioapi.h zl1211gvpatched/contrib/minizip/ioapi.h *** zl1211orig/contrib/minizip/ioapi.h Wed Sep 10 10:00:15 2003 --- zl1211gvpatched/contrib/minizip/ioapi.h Sun May 16 13:37:15 2004 *************** *** 1,9 **** /* ioapi.h -- IO base function header for compress/uncompress .zip files using zlib + zip or unzip API ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant */ #ifndef _ZLIBIOAPI_H --- 1,9 ---- /* ioapi.h -- IO base function header for compress/uncompress .zip files using zlib + zip or unzip API ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant */ #ifndef _ZLIBIOAPI_H diff -r -c zl1211orig/contrib/minizip/iowin32.c zl1211gvpatched/contrib/minizip/iowin32.c *** zl1211orig/contrib/minizip/iowin32.c Wed Sep 10 10:00:15 2003 --- zl1211gvpatched/contrib/minizip/iowin32.c Sun May 16 13:17:11 2004 *************** *** 2,10 **** files using zlib + zip or unzip API This IO API version uses the Win32 API (for Microsoft Windows) ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant */ #include --- 2,10 ---- files using zlib + zip or unzip API This IO API version uses the Win32 API (for Microsoft Windows) ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant */ #include diff -r -c zl1211orig/contrib/minizip/iowin32.h zl1211gvpatched/contrib/minizip/iowin32.h *** zl1211orig/contrib/minizip/iowin32.h Wed Sep 10 10:00:15 2003 --- zl1211gvpatched/contrib/minizip/iowin32.h Sun May 16 13:17:11 2004 *************** *** 2,10 **** files using zlib + zip or unzip API This IO API version uses the Win32 API (for Microsoft Windows) ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant */ #include --- 2,10 ---- files using zlib + zip or unzip API This IO API version uses the Win32 API (for Microsoft Windows) ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant */ #include diff -r -c zl1211orig/contrib/minizip/miniunz.c zl1211gvpatched/contrib/minizip/miniunz.c *** zl1211orig/contrib/minizip/miniunz.c Wed Sep 10 10:00:15 2003 --- zl1211gvpatched/contrib/minizip/miniunz.c Sun May 30 16:24:39 2004 *************** *** 1,3 **** --- 1,11 ---- + /* + miniunz.c + Version 1.01b, May 30th, 2004 + + Copyright (C) 1998-2004 Gilles Vollant + */ + + #include #include #include *************** *** 27,33 **** mini unzip, demo of unzip package usage : ! Usage : miniunz [-exvlo] file.zip [file_to_extract] list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT if it exists --- 35,41 ---- mini unzip, demo of unzip package usage : ! Usage : miniunz [-exvlo] file.zip [file_to_extract] [-d extractdir] list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT if it exists *************** *** 140,156 **** void do_banner() { ! printf("MiniUnz 1.00, demo of zLib + Unz package written by Gilles Vollant\n"); printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); } void do_help() { ! printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.]\n\n" \ " -e Extract without pathname (junk paths)\n" \ " -x Extract with pathname\n" \ " -v list files\n" \ " -l list files\n" \ " -o overwrite files without prompting\n" \ " -p extract crypted file using password\n\n"); } --- 148,165 ---- void do_banner() { ! printf("MiniUnz 1.01b, demo of zLib + Unz package written by Gilles Vollant\n"); printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); } void do_help() { ! printf("Usage : miniunz [-e] [-x] [-v] [-l] [-o] [-p password] file.zip [file_to_extr.] [-d extractdir]\n\n" \ " -e Extract without pathname (junk paths)\n" \ " -x Extract with pathname\n" \ " -v list files\n" \ " -l list files\n" \ + " -d directory to extract into\n" \ " -o overwrite files without prompting\n" \ " -p extract crypted file using password\n\n"); } *************** *** 304,311 **** do { char answer[128]; ! printf("The file %s exist. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename); ! scanf("%1s",answer); rep = answer[0] ; if ((rep>='a') && (rep<='z')) rep -= 0x20; --- 313,326 ---- do { char answer[128]; ! int ret; ! ! printf("The file %s exists. Overwrite ? [y]es, [n]o, [A]ll: ",write_filename); ! ret = scanf("%1s",answer); ! if (ret != 1) ! { ! exit(EXIT_FAILURE); ! } rep = answer[0] ; if ((rep>='a') && (rep<='z')) rep -= 0x20; *************** *** 459,464 **** --- 474,481 ---- int opt_do_extract=1; int opt_do_extract_withoutpath=0; int opt_overwrite=0; + int opt_extractdir=0; + const char *dirname=NULL; unzFile uf=NULL; do_banner(); *************** *** 488,493 **** --- 505,516 ---- opt_do_extract = opt_do_extract_withoutpath = 1; if ((c=='o') || (c=='O')) opt_overwrite=1; + if ((c=='d') || (c=='D')) + { + opt_extractdir=1; + dirname=argv[i+1]; + } + if (((c=='p') || (c=='P')) && (i+1 #include #include *************** *** 53,60 **** #else #ifdef unix uLong filetime(f, tmzip, dt) ! char *f; /* name of file to get info on */ ! tm_zip *tmzip; /* return value: access, modific. and creation times */ uLong *dt; /* dostime */ { int ret=0; --- 60,67 ---- #else #ifdef unix uLong filetime(f, tmzip, dt) ! char *f; /* name of file to get info on */ ! tm_zip *tmzip; /* return value: access, modific. and creation times */ uLong *dt; /* dostime */ { int ret=0; *************** *** 66,71 **** --- 73,80 ---- { char name[MAXFILENAME+1]; int len = strlen(f); + if (len > MAXFILENAME) + len = MAXFILENAME; strncpy(name, f,MAXFILENAME-1); /* strncpy doesnt append the trailing NULL, of the string is too long. */ *************** *** 120,126 **** void do_banner() { ! printf("MiniZip 1.00, demo of zLib + Zip package written by Gilles Vollant\n"); printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); } --- 129,135 ---- void do_banner() { ! printf("MiniZip 1.01b, demo of zLib + Zip package written by Gilles Vollant\n"); printf("more info at http://www.winimage.com/zLibDll/unzip.html\n\n"); } *************** *** 269,276 **** do { char answer[128]; ! printf("The file %s exist. Overwrite ? [y]es, [n]o, [a]ppend : ",filename_try); ! scanf("%1s",answer); rep = answer[0] ; if ((rep>='a') && (rep<='z')) rep -= 0x20; --- 278,290 ---- do { char answer[128]; ! int ret; ! printf("The file %s exists. Overwrite ? [y]es, [n]o, [a]ppend : ",filename_try); ! ret = scanf("%1s",answer); ! if (ret != 1) ! { ! exit(EXIT_FAILURE); ! } rep = answer[0] ; if ((rep>='a') && (rep<='z')) rep -= 0x20; *************** *** 305,311 **** for (i=zipfilenamearg+1;(i='0') || (argv[i][1]<='9'))) && ! (strlen(argv[i]) == 2))) { FILE * fin; int size_read; *************** *** 390,396 **** errclose = zipClose(zf,NULL); if (errclose != ZIP_OK) printf("error in closing %s\n",filename_try); ! } free(buf); return 0; --- 409,419 ---- errclose = zipClose(zf,NULL); if (errclose != ZIP_OK) printf("error in closing %s\n",filename_try); ! } ! else ! { ! do_help(); ! } free(buf); return 0; Only in zl1211gvpatched/contrib/minizip: mztools.c Only in zl1211gvpatched/contrib/minizip: mztools.h diff -r -c zl1211orig/contrib/minizip/unzip.c zl1211gvpatched/contrib/minizip/unzip.c *** zl1211orig/contrib/minizip/unzip.c Wed Sep 10 10:00:15 2003 --- zl1211gvpatched/contrib/minizip/unzip.c Sun May 16 13:40:11 2004 *************** *** 1,7 **** /* unzip.c -- IO for uncompress .zip files using zlib ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant Read unzip.h for more info */ --- 1,7 ---- /* unzip.c -- IO for uncompress .zip files using zlib ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant Read unzip.h for more info */ *************** *** 88,94 **** const char unz_copyright[] = ! " unzip 1.00 Copyright 1998-2003 Gilles Vollant - http://www.winimage.com/zLibDll"; /* unz_file_info_interntal contain internal info about a file in zipfile*/ typedef struct unz_file_info_internal_s --- 88,94 ---- const char unz_copyright[] = ! " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; /* unz_file_info_interntal contain internal info about a file in zipfile*/ typedef struct unz_file_info_internal_s *************** *** 798,804 **** s=(unz_s*)file; if (!s->current_file_ok) return UNZ_END_OF_LIST_OF_FILE; ! if (s->num_file+1==s->gi.number_entry) return UNZ_END_OF_LIST_OF_FILE; s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + --- 798,805 ---- s=(unz_s*)file; if (!s->current_file_ok) return UNZ_END_OF_LIST_OF_FILE; ! if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ ! if (s->num_file+1==s->gi.number_entry) return UNZ_END_OF_LIST_OF_FILE; s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + *************** *** 1461,1467 **** if (ZREAD(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream, ! buf,size_to_read)!=size_to_read) return UNZ_ERRNO; return (int)read_now; --- 1462,1468 ---- if (ZREAD(pfile_in_zip_read_info->z_filefunc, pfile_in_zip_read_info->filestream, ! buf,read_now)!=read_now) return UNZ_ERRNO; return (int)read_now; *************** *** 1543,1546 **** --- 1544,1584 ---- if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) *(szComment+s->gi.size_comment)='\0'; return (int)uReadThis; + } + + /* Additions by RX '2004 */ + extern uLong ZEXPORT unzGetOffset (file) + unzFile file; + { + unz_s* s; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + if (!s->current_file_ok) + return 0; + if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) + if (s->num_file==s->gi.number_entry) + return 0; + return s->pos_in_central_dir; + } + + extern int ZEXPORT unzSetOffset (file, pos) + unzFile file; + uLong pos; + { + unz_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz_s*)file; + + s->pos_in_central_dir = pos; + s->num_file = s->gi.number_entry; /* hack */ + err = unzlocal_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; } diff -r -c zl1211orig/contrib/minizip/unzip.h zl1211gvpatched/contrib/minizip/unzip.h *** zl1211orig/contrib/minizip/unzip.h Wed Sep 10 10:00:15 2003 --- zl1211gvpatched/contrib/minizip/unzip.h Sun May 16 13:17:11 2004 *************** *** 1,7 **** /* unzip.h -- IO for uncompress .zip files using zlib ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g WinZip, InfoZip tools and compatible. --- 1,7 ---- /* unzip.h -- IO for uncompress .zip files using zlib ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g WinZip, InfoZip tools and compatible. *************** *** 334,339 **** --- 334,349 ---- the return value is the number of bytes copied in buf, or (if <0) the error code */ + + /***************************************************************************/ + + /* Get the current file offset */ + extern uLong ZEXPORT unzGetOffset (unzFile file); + + /* Set the current file offset */ + extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); + + #ifdef __cplusplus } diff -r -c zl1211orig/contrib/minizip/zip.c zl1211gvpatched/contrib/minizip/zip.c *** zl1211orig/contrib/minizip/zip.c Wed Sep 10 10:00:17 2003 --- zl1211gvpatched/contrib/minizip/zip.c Sun May 16 13:42:45 2004 *************** *** 1,7 **** /* zip.c -- IO on .zip files using zlib ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant Read zip.h for more info */ --- 1,7 ---- /* zip.c -- IO on .zip files using zlib ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant Read zip.h for more info */ *************** *** 77,83 **** #endif #endif const char zip_copyright[] = ! " zip 1.00 Copyright 1998-2003 Gilles Vollant - http://www.winimage.com/zLibDll"; #define SIZEDATA_INDATABLOCK (4096-(4*4)) --- 77,83 ---- #endif #endif const char zip_copyright[] = ! " zip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; #define SIZEDATA_INDATABLOCK (4096-(4*4)) *************** *** 265,274 **** { unsigned char buf[4]; int n; ! for (n = 0; n < nbByte; n++) { buf[n] = (unsigned char)(x & 0xff); x >>= 8; } if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) return ZIP_ERRNO; else --- 265,283 ---- { unsigned char buf[4]; int n; ! for (n = 0; n < nbByte; n++) ! { buf[n] = (unsigned char)(x & 0xff); x >>= 8; } + if (x != 0) + { /* data overflow - hack for ZIP64 (X Roche) */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } + if (ZWRITE(*pzlib_filefunc_def,filestream,buf,nbByte)!=(uLong)nbByte) return ZIP_ERRNO; else *************** *** 287,293 **** --- 296,311 ---- buf[n] = (unsigned char)(x & 0xff); x >>= 8; } + + if (x != 0) + { /* data overflow - hack for ZIP64 */ + for (n = 0; n < nbByte; n++) + { + buf[n] = 0xff; + } + } } + /****************************************************************************/ diff -r -c zl1211orig/contrib/minizip/zip.h zl1211gvpatched/contrib/minizip/zip.h *** zl1211orig/contrib/minizip/zip.h Wed Sep 10 10:00:17 2003 --- zl1211gvpatched/contrib/minizip/zip.h Sun May 16 13:43:39 2004 *************** *** 1,7 **** /* zip.h -- IO for compress .zip files using zlib ! Version 1.00, September 10th, 2003 ! Copyright (C) 1998-2003 Gilles Vollant This unzip package allow creates .ZIP file, compatible with PKZip 2.04g WinZip, InfoZip tools and compatible. --- 1,7 ---- /* zip.h -- IO for compress .zip files using zlib ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant This unzip package allow creates .ZIP file, compatible with PKZip 2.04g WinZip, InfoZip tools and compatible. *************** *** 211,217 **** /* Close the current file in the zipfile */ - extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file, uLong uncompressed_size, --- 211,216 ---- diff -r -c zl1211orig/contrib/vstudio/readme.txt zl1211gvpatched/contrib/vstudio/readme.txt *** zl1211orig/contrib/vstudio/readme.txt Wed Aug 27 07:09:59 2003 --- zl1211gvpatched/contrib/vstudio/readme.txt Sun May 30 16:35:54 2004 *************** *** 1,5 **** ! Building instructions for the DLL versions of Zlib 1.21 ! ======================================================= This directory contains projects that build zlib and minizip using Microsoft Visual C++ 7.0/7.1. --- 1,5 ---- ! Building instructions for the DLL versions of Zlib 1.211 ! ======================================================== This directory contains projects that build zlib and minizip using Microsoft Visual C++ 7.0/7.1. *************** *** 14,20 **** Build instructions ------------------ - Unzip zlib*.zip and copy the files from contrib\vstudio\vc7, ! from contrib\vstudio\masmx86 and from contrib\minizip into the same directory. - Download the crtdll library from http://www.winimage.com/zLibDll/crtdll.zip --- 14,20 ---- Build instructions ------------------ - Unzip zlib*.zip and copy the files from contrib\vstudio\vc7, ! from contrib\masmx86 and from contrib\minizip into the same directory. - Download the crtdll library from http://www.winimage.com/zLibDll/crtdll.zip *************** *** 50,55 **** has a slightly different effect. To avoid compatibility problems, do not define it here. ! Gilles Vollant info@winimage.com --- 50,56 ---- has a slightly different effect. To avoid compatibility problems, do not define it here. ! - the core Microsoft compiler is avaiable from this URL: ! http://msdn.microsoft.com/visualc/vctoolkit2003/ Gilles Vollant info@winimage.com diff -r -c zl1211orig/contrib/vstudio/vc7/zlib.rc zl1211gvpatched/contrib/vstudio/vc7/zlib.rc *** zl1211orig/contrib/vstudio/vc7/zlib.rc Wed Mar 19 22:04:49 2003 --- zl1211gvpatched/contrib/vstudio/vc7/zlib.rc Sun May 30 16:41:27 2004 *************** *** 2,9 **** #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE ! FILEVERSION 1,2,1,0 ! PRODUCTVERSION 1,2,1,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 --- 2,9 ---- #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE ! FILEVERSION 1,2,1,1 ! PRODUCTVERSION 1,2,1,1 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 FILEOS VOS_DOS_WINDOWS32 *************** *** 17,28 **** BEGIN VALUE "FileDescription", "zlib data compression library\0" ! VALUE "FileVersion", "1.2.1.0\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlib.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" ! VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo" --- 17,28 ---- BEGIN VALUE "FileDescription", "zlib data compression library\0" ! VALUE "FileVersion", "1.2.1.1\0" VALUE "InternalName", "zlib\0" VALUE "OriginalFilename", "zlib.dll\0" VALUE "ProductName", "ZLib.DLL\0" VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant\0" ! VALUE "LegalCopyright", "(C) 1995-2004 Jean-loup Gailly & Mark Adler\0" END END BLOCK "VarFileInfo"