File openssl-CVE-2017-3735.patch of Package openssl.14115

Index: openssl-1.0.1i/crypto/x509v3/v3_addr.c
===================================================================
--- openssl-1.0.1i.orig/crypto/x509v3/v3_addr.c	2014-07-22 21:41:23.000000000 +0200
+++ openssl-1.0.1i/crypto/x509v3/v3_addr.c	2017-11-03 12:16:48.523871613 +0100
@@ -130,12 +130,12 @@ static int length_from_afi(const unsigne
  */
 unsigned int v3_addr_get_afi(const IPAddressFamily *f)
 {
-  return ((f != NULL &&
-	   f->addressFamily != NULL &&
-	   f->addressFamily->data != NULL)
-	  ? ((f->addressFamily->data[0] << 8) |
-	     (f->addressFamily->data[1]))
-	  : 0);
+    if (f == NULL
+            || f->addressFamily == NULL
+            || f->addressFamily->data == NULL
+            || f->addressFamily->length < 2)
+        return 0;
+    return (f->addressFamily->data[0] << 8) | f->addressFamily->data[1];
 }
 
 /*
openSUSE Build Service is sponsored by