From f9f81abff0ea36f19474f3b7a11bf0f17c4f116c Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Fri, 27 Mar 2015 10:31:29 +0530 Subject: [PATCH] Fix a crash while parsing malformed CAA RRs in presentation format (#39003) --- CHANGES | 6 ++++++ bin/tests/system/checkzone/zones/bad-caa-rr.db | Bin 0 -> 226 bytes lib/dns/rdata/generic/caa_257.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 bin/tests/system/checkzone/zones/bad-caa-rr.db diff --git a/CHANGES b/CHANGES index 8ff0bf79e2..fbcc8321d2 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +4090. [bug] Fix a crash while parsing malformed CAA RRs in + presentation format, i.e., from text such as + from master files. Thanks to John Van de + Meulebrouck Brendgard for discovering and + reporting this problem. [RT #39003] + 4089. [bug] Send notifies immediately for slave zones during startup. [RT #38843] diff --git a/bin/tests/system/checkzone/zones/bad-caa-rr.db b/bin/tests/system/checkzone/zones/bad-caa-rr.db new file mode 100644 index 0000000000000000000000000000000000000000..9a763a86a69ee91775a11b3c60f877979e73e7bc GIT binary patch literal 226 zcmY!habQqje5+u#je&vTA`o2qW1yg*zyQPw&VG)*u0SH!mEo^}!2*TvAo)8W0tlk@ zxP*%{9fMpI6w3a8V)$zhRPZ0D{UUp`U`8yLHJ1a>1VfN9>Iw|b(T)uY9Hw~+3g7}H~f`GH5Bak#zSZ+}N|G%{#&@BuM`<;Qb!Z!vM w1_nbD&E(9K#Gr_rRK1XTpj>{wzk)(lRn;sYuBu{StOS7uhRRByJkV?f0Or?BJOBUy literal 0 HcmV?d00001 diff --git a/lib/dns/rdata/generic/caa_257.c b/lib/dns/rdata/generic/caa_257.c index 3ca1723c55..75af983e34 100644 --- a/lib/dns/rdata/generic/caa_257.c +++ b/lib/dns/rdata/generic/caa_257.c @@ -68,7 +68,7 @@ fromtext_caa(ARGS_FROMTEXT) { ISC_FALSE)); tr = token.value.as_textregion; for (i = 0; i < tr.length; i++) - if (!alphanumeric[(unsigned int) tr.base[i]]) + if (!alphanumeric[(unsigned char) tr.base[i]]) RETTOK(DNS_R_SYNTAX); RETERR(uint8_tobuffer(tr.length, target)); RETERR(mem_tobuffer(target, tr.base, tr.length));