Merge branch 'tizen' into tizen_base 34/158934/1 accepted/tizen_4.0_base accepted/tizen/4.0/base/20171110.190343 submit/tizen_4.0_base/20171106.054347 tizen_4.0.IoT.p2_release
authorJiung <jiung.yu@samsung.com>
Mon, 7 Aug 2017 04:59:41 +0000 (13:59 +0900)
committerJiung Yu <jiung.yu@samsung.com>
Mon, 6 Nov 2017 04:47:59 +0000 (04:47 +0000)
Change-Id: I57bed66206d1aab30e02ded357d1ff4f2d444ed6

ares_parse_naptr_reply.c

index 11634df..0e37b02 100644 (file)
@@ -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)