Skip to content

net: fix crash if POLLHUP is received

Rodrigo Muino Tomonari requested to merge github/fork/santigimeno/bug_31823 into master

If the onread socket option is used and a POLLHUP event is received, libuv returns UV_EOF along with a NULL buffer in the read callback, causing the crash. Deal with this case. See: https://github.com/nodejs/node/blob/master/deps/uv/src/unix/stream.c#L1317-L1323

Fixes: https://github.com/nodejs/node/issues/31823

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Merge request reports

Loading