src: fix use-after-return in zlib bindings · nodejs/node@ce039c3 · GitHub
Skip to content

Commit ce039c3

Browse files
bnoordhuisFishrock123
authored andcommitted
src: fix use-after-return in zlib bindings
Pointed out by Coverity. Introduced in commit 5b8e1da from September 2011 ("Initial pass at zlib bindings".) The asynchronous version of Write() used a pointer to a stack-allocated buffer on flush. A mitigating factor is that zlib does not dereference the pointer for zero-sized writes but it's still technically UB. PR-URL: #7374 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 2816418 commit ce039c3

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/node_zlib.cc

Lines changed: 1 addition & 2 deletions

0 commit comments

Comments
 (0)