zlib: validate pledgedSrcSize for sync zstd · nodejs/node@ee7bf09 · GitHub
Skip to content

Commit ee7bf09

Browse files
Archkonaduh95
authored andcommitted
zlib: validate pledgedSrcSize for sync zstd
Zstd replaces a configured pledged source size with the input size when the first call to ZSTD_compressStream2() uses ZSTD_e_end. Track consumed input in Node and report ZSTD_error_srcSize_wrong when the completed frame does not match the original pledge. Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com> PR-URL: #64601 Fixes: #64600 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh>
1 parent 82b2d9c commit ee7bf09

2 files changed

Lines changed: 70 additions & 8 deletions

File tree

src/node_zlib.cc

Lines changed: 22 additions & 1 deletion

test/parallel/test-zlib-zstd-pledged-src-size.js

Lines changed: 48 additions & 7 deletions

0 commit comments

Comments
 (0)