From 5e125c9a312d793ae49f375fd99d2e325739012a Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 2 Feb 2017 19:44:18 -0700 Subject: [PATCH] don't pass too much data --- dns.rdata.parse.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dns.rdata.parse.js b/dns.rdata.parse.js index 5defe27..1f8caf4 100644 --- a/dns.rdata.parse.js +++ b/dns.rdata.parse.js @@ -39,8 +39,10 @@ exports.DNS_RDATA_PARSE = function (ab, packet, record) { // NOTE: record will be modified // Things that get added include: - // address, data, priority exchange, weight, - return parser(ab, packet, record); + // address, data, priority exchange, weight, + // NOTE: this slicing is a shim so that we don't have to pass rdend to unpackLabel + // (because `undefined` and 0x00 are functionally equivalent) + return parser(ab.slice(0, record.rdstart + record.rdlength), packet, record); }; }('undefined' !== typeof window ? window : exports));