diff options
author | David Drysdale <drysdale@google.com> | 2017-05-22 10:54:10 +0100 |
---|---|---|
committer | Nishant Chaprana <n.chaprana@samsung.com> | 2019-01-28 08:59:44 +0530 |
commit | f5ca34c39b5fb01031e93619b573907cc46b1a4a (patch) | |
tree | c84635821d64e515873df3a955ea457d4d9d58b1 | |
parent | 5bcd3658f45d71808854d4425a1f466780d70bf9 (diff) | |
download | c-ares-f5ca34c39b5fb01031e93619b573907cc46b1a4a.tar.gz c-ares-f5ca34c39b5fb01031e93619b573907cc46b1a4a.tar.bz2 c-ares-f5ca34c39b5fb01031e93619b573907cc46b1a4a.zip |
ares_parse_naptr_reply: check sufficient datatizen_6.0.m2_releasetizen_5.5.m2_releasesubmit/tizen_base/20190311.051335submit/tizen_6.0_base_hotfix/20201102.162701submit/tizen_6.0_base_hotfix/20201030.192501submit/tizen_6.0_base/20201029.184801submit/tizen_5.5_base_wearable_hotfix/20201023.155601submit/tizen_5.5_base_mobile_hotfix/20201023.171501submit/tizen_5.5_base/20191030.000001accepted/tizen/base/20190316.131830accepted/tizen/6.0/base/hotfix/20201102.093258accepted/tizen/6.0/base/20201029.110307accepted/tizen/5.5/base/wearable/hotfix/20201023.081830accepted/tizen/5.5/base/mobile/hotfix/20201023.085651accepted/tizen/5.5/base/20191030.084059tizen_6.0_base_hotfixtizen_6.0_basetizen_5.5_tvtizen_5.5_base_wearable_hotfixtizen_5.5_base_mobile_hotfixtizen_5.5_baseaccepted/tizen_6.0_base_hotfixaccepted/tizen_6.0_baseaccepted/tizen_5.5_base_wearable_hotfixaccepted/tizen_5.5_base_mobile_hotfixaccepted/tizen_5.5_base
Check that there is enough data for the required elements
of an NAPTR record (2 int16, 3 bytes for string lengths)
before processing a record.
Bug: https://c-ares.haxx.se/adv_20170620.html
Patch Link: https://c-ares.haxx.se/CVE-2017-1000381.patch
Change-Id: I16056280817af5cd7a62ddc366280c73391cbc6a
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
-rw-r--r-- | ares_parse_naptr_reply.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ares_parse_naptr_reply.c b/ares_parse_naptr_reply.c index 0e37b02..6216ca7 100644 --- a/ares_parse_naptr_reply.c +++ b/ares_parse_naptr_reply.c @@ -110,6 +110,12 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen, status = ARES_EBADRESP; break; } + /* RR must contain at least 7 bytes = 2 x int16 + 3 x name */ + if (rr_len < 7) + { + status = ARES_EBADRESP; + break; + } /* Check if we are really looking at a NAPTR record */ if (rr_class == C_IN && rr_type == T_NAPTR) @@ -192,4 +198,3 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen, return ARES_SUCCESS; } - |