Blame SOURCES/openssl-1.0.2k-cve-2017-3735.patch

aa8173
diff -up openssl-1.0.2k/crypto/x509v3/v3_addr.c.overread openssl-1.0.2k/crypto/x509v3/v3_addr.c
aa8173
--- openssl-1.0.2k/crypto/x509v3/v3_addr.c.overread	2017-01-26 14:22:04.000000000 +0100
aa8173
+++ openssl-1.0.2k/crypto/x509v3/v3_addr.c	2018-06-18 13:49:30.001625137 +0200
aa8173
@@ -130,10 +130,12 @@ static int length_from_afi(const unsigne
aa8173
  */
aa8173
 unsigned int v3_addr_get_afi(const IPAddressFamily *f)
aa8173
 {
aa8173
-    return ((f != NULL &&
aa8173
-             f->addressFamily != NULL && f->addressFamily->data != NULL)
aa8173
-            ? ((f->addressFamily->data[0] << 8) | (f->addressFamily->data[1]))
aa8173
-            : 0);
aa8173
+    if (f == NULL
aa8173
+            || f->addressFamily == NULL
aa8173
+            || f->addressFamily->data == NULL
aa8173
+            || f->addressFamily->length < 2)
aa8173
+        return 0;
aa8173
+    return (f->addressFamily->data[0] << 8) | f->addressFamily->data[1];
aa8173
 }
aa8173
 
aa8173
 /*