net: make holding the buffer in memory more robust
Checklist
-
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
net/src?
Description of change
Set the req.buffer
property, which serves as a way of keeping a Buffer
alive that is being written to a stream, on the C++ side instead of the JS side.
This closes a hole where buffers that were temporarily created in order to write strings with uncommon encodings (e.g. hex
) were passed to the native side without being set as req.buffer
.
Fixes: https://github.com/nodejs/node/issues/8251 CI: https://ci.nodejs.org/job/node-test-commit/4749/