Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffer::Length hard crashes #11954

Closed
deian opened this issue Mar 21, 2017 · 0 comments · May be fixed by XirdigH/node-22#60, baby636/node#22, Dmarch28/node#37, baby636/node#23 or baby636/node#24
Closed

Buffer::Length hard crashes #11954

deian opened this issue Mar 21, 2017 · 0 comments · May be fixed by XirdigH/node-22#60, baby636/node#22, Dmarch28/node#37, baby636/node#23 or baby636/node#24
Assignees
Labels
buffer Issues and PRs related to the buffer subsystem. confirmed-bug Issues with confirmed bugs.

Comments

@deian
Copy link
Member

deian commented Mar 21, 2017

  • Version: 6.9.2 -> 7.2.0
  • Platform: Linux
  • Subsystem:

Buffer::Length hard crashes.

I know that there are other issues where what to do about crashing bugs is being discussed, but I think most of the other examples are code directly accessible to JavaScript via process.binding. Here is an example that is something more subtle, but nevertheless can be triggered.

const dgram = require('dgram');
const util = require('util');
// Create object that passes instanceof Buffer check
function FakeBuffer() { }
util.inherits(FakeBuffer, Buffer);
const message = new FakeBuffer();
// Pass object to code that eventually calls Length
dgram.createSocket('udp4'). send(message, 41234, 'localhost', _ => {});
@TimothyGu TimothyGu self-assigned this Mar 21, 2017
@TimothyGu TimothyGu added buffer Issues and PRs related to the buffer subsystem. confirmed-bug Issues with confirmed bugs. labels Mar 21, 2017
addaleax added a commit to addaleax/node that referenced this issue Mar 22, 2017
TimothyGu added a commit to TimothyGu/node that referenced this issue Sep 22, 2017
Make "fake" Buffer subclasses whose instances are not valid Uint8Arrays
fail the test.

Fixes: nodejs#11954
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment