Skip to content

Commit

Permalink
Added a test for string plausibility checking
Browse files Browse the repository at this point in the history
When a string length within a variable header would exceed the overall
packet length, the string parsing should return an error
  • Loading branch information
Peter Sorowka committed Jan 14, 2016
1 parent da768a7 commit 2c5b0cc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -919,3 +919,16 @@ testParseError('invalid protocol version', new Buffer([
0, 4, //Client id length
116, 101, 115, 116 // Client id
]))

testParseError('cannot parse protocol id', new Buffer([
16, 8,
0, 15,
77, 81, 73, 115, 100, 112,
77, 81, 73, 115, 100, 112,
77, 81, 73, 115, 100, 112,
77, 81, 73, 115, 100, 112,
77, 81, 73, 115, 100, 112,
77, 81, 73, 115, 100, 112,
77, 81, 73, 115, 100, 112,
77, 81, 73, 115, 100, 112
]))

0 comments on commit 2c5b0cc

Please sign in to comment.