Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
fixed a bug where a packet less than 16 bytes long would crash the se…
Browse files Browse the repository at this point in the history
…rver
  • Loading branch information
bjyoungblood committed Jan 5, 2012
1 parent 1985b08 commit 1531091
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/data-handler.js
Expand Up @@ -40,7 +40,7 @@ exports.fromBuffer = function(pduBuffer, splitBuffer) {
// something wrong, and we should probably emit an error from here instead
// of returning false (TODO)
if (pduBuffer.length < 16) {
return false;
throw "not enough data";
}

bufferPosition = 0;
Expand Down
1 change: 1 addition & 0 deletions lib/server-connection.js
Expand Up @@ -90,6 +90,7 @@ var serverConnection = function(socket, server, closeConnectionServerCallback, c
} catch (err) {
self.generic_nack();
self.emit('error', client, err);
return;
}

pdus = parsedBuffer.pdus;
Expand Down

0 comments on commit 1531091

Please sign in to comment.