svn commit: r326357 - stable/10/crypto/openssl/crypto/x509v3

Xin LI delphij at FreeBSD.org
Wed Nov 29 05:35:29 UTC 2017


Author: delphij
Date: Wed Nov 29 05:35:28 2017
New Revision: 326357
URL: https://svnweb.freebsd.org/changeset/base/326357

Log:
  Avoid out-of-bounds read.
  
  Security:	CVE-2017-3735
  Security:	FreeBSD-SA-17:11.openssl
  Obtained from:	OpenSSL https://github.com/openssl/openssl/pull/4276

Modified:
  stable/10/crypto/openssl/crypto/x509v3/v3_addr.c

Modified: stable/10/crypto/openssl/crypto/x509v3/v3_addr.c
==============================================================================
--- stable/10/crypto/openssl/crypto/x509v3/v3_addr.c	Wed Nov 29 05:07:54 2017	(r326356)
+++ stable/10/crypto/openssl/crypto/x509v3/v3_addr.c	Wed Nov 29 05:35:28 2017	(r326357)
@@ -130,10 +130,12 @@ static int length_from_afi(const unsigned afi)
  */
 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];
 }
 
 /*


More information about the svn-src-all mailing list