Date: Wed, 29 Nov 2017 05:35:28 +0000 (UTC) From: Xin LI <delphij@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r326357 - stable/10/crypto/openssl/crypto/x509v3 Message-ID: <201711290535.vAT5ZSRn096122@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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]; } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711290535.vAT5ZSRn096122>