Blame SOURCES/0003-c-ares-NAPTR-parser-out-of-bounds-access.patch

7e0d7f
From 15dfe22be278cb1f0194de0b0ab790ba9dc4fc33 Mon Sep 17 00:00:00 2001
7e0d7f
From: Zuzana Svetlikova <zsvetlik@redhat.com>
7e0d7f
Date: Fri, 23 Jun 2017 23:11:28 +0200
7e0d7f
Subject: [PATCH] c-ares NAPTR parser out of bounds access
7e0d7f
7e0d7f
CVE: CVE-2017-1000381
7e0d7f
Upstream bug: https://c-ares.haxx.se/adv_20170620.html
7e0d7f
---
7e0d7f
 deps/cares/src/ares_parse_naptr_reply.c | 7 ++++++-
7e0d7f
 1 file changed, 6 insertions(+), 1 deletion(-)
7e0d7f
7e0d7f
diff --git a/deps/cares/src/ares_parse_naptr_reply.c b/deps/cares/src/ares_parse_naptr_reply.c
7e0d7f
index 11634df984..717d355778 100644
7e0d7f
--- a/deps/cares/src/ares_parse_naptr_reply.c
7e0d7f
+++ b/deps/cares/src/ares_parse_naptr_reply.c
7e0d7f
@@ -110,6 +110,12 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen,
7e0d7f
           status = ARES_EBADRESP;
7e0d7f
           break;
7e0d7f
         }
7e0d7f
+      /* RR must contain at least 7 bytes = 2 x int16 + 3 x name */
7e0d7f
+      if (rr_len < 7)
7e0d7f
+        {
7e0d7f
+          status = ARES_EBADRESP;
7e0d7f
+          break;
7e0d7f
+        }
7e0d7f
 
7e0d7f
       /* Check if we are really looking at a NAPTR record */
7e0d7f
       if (rr_class == C_IN && rr_type == T_NAPTR)
7e0d7f
@@ -185,4 +191,3 @@ ares_parse_naptr_reply (const unsigned char *abuf, int alen,
7e0d7f
 
7e0d7f
   return ARES_SUCCESS;
7e0d7f
 }
7e0d7f
-
7e0d7f
-- 
7e0d7f
2.13.1
7e0d7f