commit f2873c1209e462c5829d4bd2e215261f25a8e6e5
parent 5976c419f06ff31321efbede90786d6595861caf
Author: Drew DeVault <sir@cmpwn.com>
Date: Wed, 23 Jun 2021 12:26:56 -0400
net::dns: fix decoding error w/multiple rrecords
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/dns/decode.ha b/net/dns/decode.ha
@@ -147,7 +147,7 @@ fn decode_rdata(dec: *decoder, rtype: rtype, rlen: size) (rdata | format) = {
};
fn decode_a(dec: *decoder) (rdata | format) = {
- if (len(dec.cur) != 4) {
+ if (len(dec.cur) < 4) {
return format;
};
let ip: ip::addr4 = [0...];
@@ -157,7 +157,7 @@ fn decode_a(dec: *decoder) (rdata | format) = {
};
fn decode_aaaa(dec: *decoder) (rdata | format) = {
- if (len(dec.cur) != 8) {
+ if (len(dec.cur) < 8) {
return format;
};
let ip: ip::addr6 = [0...];