Closed saneki closed 8 years ago
Yes, that'd be da fix. Thanks for this PR, we're really low on time nowadays. @TooTallNate, do we merge?
Side note, there is that WrapPointer method exists at ffi code base, so that gotta be fixed eventually. But AFAIK we're not mapping nulls with that.
I think this is the proper fix, but can you add a regression test? Basically attempting to read a null pointer with > 0 bytes length and asserting that the resulting buffer.length === 0
.
Done, but make sure I implemented it correctly
Perfect! Landed in b151fd4af266c08f2c506fe9915570d2288b0377.
I'm still curious as to what caused the regression in the first place, but this seems like a proper fix (I see no reason to ever have a length on a NULL pointer, since that would cause a segfault), so not 100% necessary.
Not sure if this will fix all cases, but causes my unit tests to pass instead of erroring with
Assertion '(obj_data) != (nullptr)' failed
after updating to node.js 4.