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

Unified Diff: third_party/zlib/contrib/minizip/mztools.c

Issue 2084863002: Update Zlib to version 1.2.8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/zlib/contrib/minizip/mztools.h ('k') | third_party/zlib/contrib/minizip/unzip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/zlib/contrib/minizip/mztools.c
diff --git a/third_party/zlib/contrib/minizip/mztools.c b/third_party/zlib/contrib/minizip/mztools.c
index 026bf2820e60bddf3016b81df86afc0860f2d538..8bf9cca326338a0de6634359069bc8bd0d0b40db 100644
--- a/third_party/zlib/contrib/minizip/mztools.c
+++ b/third_party/zlib/contrib/minizip/mztools.c
@@ -42,7 +42,7 @@ uLong* bytesRecovered;
int entries = 0;
uLong totalBytes = 0;
char header[30];
- char filename[256];
+ char filename[1024];
char extra[1024];
int offset = 0;
int offsetCD = 0;
@@ -73,9 +73,14 @@ uLong* bytesRecovered;
/* Filename */
if (fnsize > 0) {
- if (fread(filename, 1, fnsize, fpZip) == fnsize) {
- if (fwrite(filename, 1, fnsize, fpOut) == fnsize) {
- offset += fnsize;
+ if (fnsize < sizeof(filename)) {
+ if (fread(filename, 1, fnsize, fpZip) == fnsize) {
+ if (fwrite(filename, 1, fnsize, fpOut) == fnsize) {
+ offset += fnsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
} else {
err = Z_ERRNO;
break;
@@ -91,9 +96,14 @@ uLong* bytesRecovered;
/* Extra field */
if (extsize > 0) {
- if (fread(extra, 1, extsize, fpZip) == extsize) {
- if (fwrite(extra, 1, extsize, fpOut) == extsize) {
- offset += extsize;
+ if (extsize < sizeof(extra)) {
+ if (fread(extra, 1, extsize, fpZip) == extsize) {
+ if (fwrite(extra, 1, extsize, fpOut) == extsize) {
+ offset += extsize;
+ } else {
+ err = Z_ERRNO;
+ break;
+ }
} else {
err = Z_ERRNO;
break;
« no previous file with comments | « third_party/zlib/contrib/minizip/mztools.h ('k') | third_party/zlib/contrib/minizip/unzip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698