summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiung <jiung.yu@samsung.com>2017-08-07 13:59:41 +0900
committerJiung Yu <jiung.yu@samsung.com>2017-08-07 05:02:05 +0000
commit5bcd3658f45d71808854d4425a1f466780d70bf9 (patch)
tree7a9ce601bf43420fdcfde2977c70c3650b8af332
parent8166b0204b6945a4fdb89bbae0b0b7168a7cf6e8 (diff)
parentedc447f2f3134d81575f16b1701fc802161f153f (diff)
downloadc-ares-5bcd3658f45d71808854d4425a1f466780d70bf9.tar.gz
c-ares-5bcd3658f45d71808854d4425a1f466780d70bf9.tar.bz2
c-ares-5bcd3658f45d71808854d4425a1f466780d70bf9.zip
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)