summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiung <jiung.yu@samsung.com>2017-08-07 04:59:41 (GMT)
committerJiung Yu <jiung.yu@samsung.com>2017-11-06 04:47:59 (GMT)
commit99c49e08750dc756c0c9634a6d12e0af81b9881c (patch)
tree7a9ce601bf43420fdcfde2977c70c3650b8af332
parent8166b0204b6945a4fdb89bbae0b0b7168a7cf6e8 (diff)
downloadc-ares-accepted/tizen_4.0_base.zip
c-ares-accepted/tizen_4.0_base.tar.gz
c-ares-accepted/tizen_4.0_base.tar.bz2
Change-Id: I57bed66206d1aab30e02ded357d1ff4f2d444ed6
-rw-r--r--ares_parse_naptr_reply.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ares_parse_naptr_reply.c b/ares_parse_naptr_reply.c
index 11634df..0e37b02 100644
--- a/ares_parse_naptr_reply.c
+++ b/ares_parse_naptr_reply.c
@@ -116,6 +116,13 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen,
{
/* parse the NAPTR record itself */
+ /* RR must contain at least 7 bytes = 2 x int16 + 3 x name */
+ if (rr_len < 7)
+ {
+ status = ARES_EBADRESP;
+ break;
+ }
+
/* Allocate storage for this NAPTR answer appending it to the list */
naptr_curr = ares_malloc_data(ARES_DATATYPE_NAPTR_REPLY);
if (!naptr_curr)