diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-09-25 19:45:15 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-09-25 19:45:15 (GMT) |
commit | 3dce0b31fc75ae153d7e698c1adde5de6fd7dec3 (patch) | |
tree | a466886bd883e739224d6de1d854e7ee339b2dfc /generic | |
parent | d3ec5a1fb59c1b5e51d4492e69d5205300e3f2e8 (diff) | |
download | tcl-3dce0b31fc75ae153d7e698c1adde5de6fd7dec3.zip tcl-3dce0b31fc75ae153d7e698c1adde5de6fd7dec3.tar.gz tcl-3dce0b31fc75ae153d7e698c1adde5de6fd7dec3.tar.bz2 |
Start on [d5d03207ca]
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclZipfs.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c index 510fa33..ceccd9e 100644 --- a/generic/tclZipfs.c +++ b/generic/tclZipfs.c @@ -4342,14 +4342,14 @@ ZipChannelWrite( *errloc = EINVAL; return -1; } - nextpos = info->numRead + toWrite; - if (nextpos > info->maxWrite) { + if (toWrite > info->maxWrite - info->numRead) { toWrite = info->maxWrite - info->numRead; - nextpos = info->maxWrite; } if (toWrite == 0) { - return 0; + *errloc = EFBIG; + return -1; } + nextpos = info->numRead + toWrite; memcpy(info->ubuf + info->numRead, buf, toWrite); info->numRead = nextpos; if (info->numRead > info->numBytes) { |