Skip to content

src: fix null deref in AllocatedBuffer::clear

Rodrigo Muino Tomonari requested to merge github/fork/fowles/v12.x into v12.x

An empty buffer can have a null environment. Previously, we were getting away with with this, but -fsanitize=null in clang caught it.

Cherry-pick of https://github.com/nodejs/node/pull/32892 to v12.x branch.

Ref: https://github.com/nodejs/node/pull/32892

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows [commit guidelines]

Merge request reports

Loading