Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: third_party/zlib/contrib/minizip/unzip.c

Issue 222243003: Fixed uncompressing files with wrong uncompressed size set. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: white line Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/zlib/google/test/data/test_mismatch_size.zip » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* unzip.c -- IO for uncompress .zip files using zlib 1 /* unzip.c -- IO for uncompress .zip files using zlib
2 Version 1.1, February 14h, 2010 2 Version 1.1, February 14h, 2010
3 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) 3 part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
4 4
5 Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage. com/zLibDll/minizip.html ) 5 Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage. com/zLibDll/minizip.html )
6 6
7 Modifications of Unzip for Zip64 7 Modifications of Unzip for Zip64
8 Copyright (C) 2007-2008 Even Rouault 8 Copyright (C) 2007-2008 Even Rouault
9 9
10 Modifications for Zip64 support on both zip and unzip 10 Modifications for Zip64 support on both zip and unzip
(...skipping 1687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1698 1698
1699 if ((pfile_in_zip_read_info->read_buffer == NULL)) 1699 if ((pfile_in_zip_read_info->read_buffer == NULL))
1700 return UNZ_END_OF_LIST_OF_FILE; 1700 return UNZ_END_OF_LIST_OF_FILE;
1701 if (len==0) 1701 if (len==0)
1702 return 0; 1702 return 0;
1703 1703
1704 pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; 1704 pfile_in_zip_read_info->stream.next_out = (Bytef*)buf;
1705 1705
1706 pfile_in_zip_read_info->stream.avail_out = (uInt)len; 1706 pfile_in_zip_read_info->stream.avail_out = (uInt)len;
1707 1707
1708 if ((len>pfile_in_zip_read_info->rest_read_uncompressed) &&
1709 (!(pfile_in_zip_read_info->raw)))
1710 pfile_in_zip_read_info->stream.avail_out =
1711 (uInt)pfile_in_zip_read_info->rest_read_uncompressed;
1712
1713 if ((len>pfile_in_zip_read_info->rest_read_compressed+ 1708 if ((len>pfile_in_zip_read_info->rest_read_compressed+
1714 pfile_in_zip_read_info->stream.avail_in) && 1709 pfile_in_zip_read_info->stream.avail_in) &&
1715 (pfile_in_zip_read_info->raw)) 1710 (pfile_in_zip_read_info->raw))
1716 pfile_in_zip_read_info->stream.avail_out = 1711 pfile_in_zip_read_info->stream.avail_out =
1717 (uInt)pfile_in_zip_read_info->rest_read_compressed+ 1712 (uInt)pfile_in_zip_read_info->rest_read_compressed+
1718 pfile_in_zip_read_info->stream.avail_in; 1713 pfile_in_zip_read_info->stream.avail_in;
1719 1714
1720 while (pfile_in_zip_read_info->stream.avail_out>0) 1715 while (pfile_in_zip_read_info->stream.avail_out>0)
1721 { 1716 {
1722 if ((pfile_in_zip_read_info->stream.avail_in==0) && 1717 if ((pfile_in_zip_read_info->stream.avail_in==0) &&
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
2116 &s->cur_file_info_internal, 2111 &s->cur_file_info_internal,
2117 NULL,0,NULL,0,NULL,0); 2112 NULL,0,NULL,0,NULL,0);
2118 s->current_file_ok = (err == UNZ_OK); 2113 s->current_file_ok = (err == UNZ_OK);
2119 return err; 2114 return err;
2120 } 2115 }
2121 2116
2122 extern int ZEXPORT unzSetOffset (unzFile file, uLong pos) 2117 extern int ZEXPORT unzSetOffset (unzFile file, uLong pos)
2123 { 2118 {
2124 return unzSetOffset64(file,pos); 2119 return unzSetOffset64(file,pos);
2125 } 2120 }
OLDNEW
« no previous file with comments | « no previous file | third_party/zlib/google/test/data/test_mismatch_size.zip » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698