Unsafe memory allocation #10

Open
OrangeDog opened this Issue Nov 17, 2011 · 3 comments

Projects

None yet

2 participants

@OrangeDog

Buffer::New can return NULL but this is never checked (e.g. compress.cc:238), causing segfaults later on.

@OrangeDog

This commit fixes the segfault, but I can't seem to send a pull request of just this one.

OrangeDog@2d774a7

@Woodya
Owner
Woodya commented Jan 8, 2015

thanks, sorry haven't been maintaining this. i'll fold this in this week after i look it over.

@Woodya
Owner
Woodya commented Jan 8, 2015

@OrangeDog do you have an example where Buffer::New returns null?
i think the snprintf changes look good, but looking at the (current) bufferr::new impl, i'm unsure if the buffer::new -> NULL issue still exists, or was "fixed" at the root.
https://github.com/joyent/node/blob/master/src/node_buffer.cc#L157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment