components/libevent/patches/CVE-2016-10195.patch
author Rich Burridge <rich.burridge@oracle.com>
Thu, 02 Feb 2017 15:16:38 -0800
changeset 7638 b2986f4bf55a
permissions -rw-r--r--
25489439 problem in LIBRARY/LIBEVENT

Fix for CVE-2016-10195

More details at:

  https://github.com/libevent/libevent/issues/317

Based on commit at:

  https://github.com/libevent/libevent/commit/96f64a022014a208105ead6c8a7066018449d86d

--- libevent-2.0.22/evdns.c.orig	2017-02-02 07:18:16.307620386 +0000
+++ libevent-2.0.22/evdns.c	2017-02-02 07:23:36.432656559 +0000
@@ -960,7 +960,6 @@
 
 	for (;;) {
 		u8 label_len;
-		if (j >= length) return -1;
 		GET8(label_len);
 		if (!label_len) break;
 		if (label_len & 0xc0) {
@@ -980,7 +979,7 @@
 			if (cp + 1 >= end) return -1;
 			*cp++ = '.';
 		}
-		if (cp + label_len >= end) return -1;
+		if (j + label_len > length) return -1;
 		memcpy(cp, packet + j, label_len);
 		cp += label_len;
 		j += label_len;