mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
Avoid out-of-bounds read
Fixes CVE 2017-3735 Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/4276)
This commit is contained in:
parent
302eba3f6d
commit
b23171744b
@ -84,10 +84,12 @@ static int length_from_afi(const unsigned afi)
|
||||
*/
|
||||
unsigned int X509v3_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];
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user