summaryrefslogtreecommitdiff
path: root/plugins/BasicHistory/src/zip/mztools.c
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-08-07 12:20:44 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-08-07 12:20:44 +0000
commit7df6611bd27389f5fa73eea55ac0b1dcf54dda25 (patch)
treef250448936a4941b62336a7baef13582f16d07e9 /plugins/BasicHistory/src/zip/mztools.c
parent20928b2140adc81e9b3fcbbcc855d7e6ed2d4358 (diff)
minizip updated
zlib libs removed coz we have dll in miranda git-svn-id: http://svn.miranda-ng.org/main/trunk@5610 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/BasicHistory/src/zip/mztools.c')
-rw-r--r--plugins/BasicHistory/src/zip/mztools.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/plugins/BasicHistory/src/zip/mztools.c b/plugins/BasicHistory/src/zip/mztools.c
index f9092e65ae..96891c2e0b 100644
--- a/plugins/BasicHistory/src/zip/mztools.c
+++ b/plugins/BasicHistory/src/zip/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;