Fix for CVE-2016-10196
More details at:
https://github.com/libevent/libevent/issues/318
Based on commit at:
https://github.com/libevent/libevent/commit/329acc18a0768c21ba22522f01a5c7f46cacc4d5
--- libevent-2.0.22/evutil.c.orig 2017-02-02 07:20:55.460219824 +0000
+++ libevent-2.0.22/evutil.c 2017-02-02 07:25:18.285916416 +0000
@@ -1808,12 +1808,12 @@
cp = strchr(ip_as_string, ':');
if (*ip_as_string == '[') {
- int len;
+ size_t len;
if (!(cp = strchr(ip_as_string, ']'))) {
return -1;
}
- len = (int) ( cp-(ip_as_string + 1) );
- if (len > (int)sizeof(buf)-1) {
+ len = ( cp-(ip_as_string + 1) );
+ if (len > sizeof(buf)-1) {
return -1;
}
memcpy(buf, ip_as_string+1, len);