Merge pull request #4808 from akallabeth/tls_extract_pem_fix

Fixed #4806 broken bounds check.
This commit is contained in:
Martin Fleisz 2018-08-21 10:01:47 +02:00 committed by GitHub
commit 560552ce19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1260,7 +1260,7 @@ static BOOL tls_extract_pem(CryptoCert cert, BYTE** PublicKey, DWORD* PublicKeyL
length = new_len;
pemCert = new_cert;
status = BIO_read(bio, &pemCert[offset], length);
status = BIO_read(bio, &pemCert[offset], length - offset);
if (status < 0)
break;