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

Tests failure: Invalid requests test broken #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ function domain_parts(msg, offset) {
while(true) {
if(++i >= 100)
throw new Error('Too many iterations uncompressing name')
else if(msg.length <= offset)
throw new Error('Received invalid request')

var byte = msg.readUInt8(offset)
, flags = byte >> 6
Expand Down
4 changes: 2 additions & 2 deletions test/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ test('Network queries', function(t) {
})

test('Invalid queries', function(t) {
var reqs = { 'short-query' : { message:'Error processing request', error: 'RangeError: Trying to access beyond buffer length' }
, 'garbage' : { message:'Error processing request', error: 'RangeError: Trying to access beyond buffer length' }
var reqs = { 'short-query' : { message:'Error processing request', error: 'Error: Received invalid request' }
, 'garbage' : { message:'Error processing request', error: 'Error: Received invalid request' }
}

var i = 0
Expand Down