Skip to content
Closed
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 encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ State.prototype.record = function(section_name, record) {

// Write the rdata. Update the position now (the rdata length value) in case self.encode() runs.
var match, rdata
if(record.data === null)
return
switch (record.class + ' ' + record.type) {
case 'IN A':
rdata = record.data || ''
Expand Down
2 changes: 1 addition & 1 deletion message.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ DNSMessage.prototype.toBinary = function() {

msg[section] = msg[section] || []
msg[section].forEach(function(record) {
if(record.class != 'IN')
if(record.class != 'IN' || record.data === null)
return

// Make sure records promising data have data.
Expand Down