Skip to content

Commit

Permalink
[core/zip] Properly account for HDRSIZE in R__zipZLIB
Browse files Browse the repository at this point in the history
R__unzipZLIB is already properly subtracting it from srcsize.
  • Loading branch information
hahnjo committed Feb 8, 2024
1 parent ad50d5f commit 44d1c23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/zip/src/RZip.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ static void R__zipZLIB(int cxlevel, int *srcsize, char *src, int *tgtsize, char
stream.avail_in = (uInt)(*srcsize);

stream.next_out = (Bytef*)(&tgt[HDRSIZE]);
stream.avail_out = (uInt)(*tgtsize);
stream.avail_out = (uInt)(*tgtsize) - HDRSIZE;

stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
Expand Down

0 comments on commit 44d1c23

Please sign in to comment.