Skip to content

Commit

Permalink
Fix debug message for the "Encountered unknown pointer type" message
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Sep 22, 2020
1 parent fb90d76 commit f05f2eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/coder/DNSLabelCoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export class DNSLabelCoder {
let name = "";

for (;;) {
const length = this.buffer.readUInt8(offset++);
const length: number = this.buffer.readUInt8(offset++);
if (length === 0) { // zero byte to terminate the name
name += ".";
break; // root label marks end of name
Expand All @@ -256,7 +256,8 @@ export class DNSLabelCoder {
name += (name? ".": "") + this.decodeName(pointer).data; // recursively decode the rest of the name
break; // pointer marks end of name
} else {
assert.fail("Encountered unknown pointer type: " + Buffer.from([labelTypePattern >> 6]).toString("binary"));
assert.fail("Encountered unknown pointer type: " + Buffer.from([labelTypePattern >> 6]).toString("hex") + " (with original byte " +
Buffer.from([length]).toString("hex") + ")");
}
}

Expand Down

0 comments on commit f05f2eb

Please sign in to comment.