diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-03-08 09:25:54 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-03-31 19:53:05 +0200 |
commit | e1428c62a1588def5af25678583f1a0166adf924 (patch) | |
tree | 8542d43d4fe6dda56a47b1592097658c54fc9f8f /crypto/http | |
parent | 534725fd4389782d693cff061f4d31b786058ab1 (diff) |
http_client.c: Prevent spurious error queue entry on NULL mem argument
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14630)
Diffstat (limited to 'crypto/http')
-rw-r--r-- | crypto/http/http_client.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/http/http_client.c b/crypto/http/http_client.c index 8e4f8e8c83..eec13973fb 100644 --- a/crypto/http/http_client.c +++ b/crypto/http/http_client.c @@ -734,13 +734,12 @@ static BIO *HTTP_new_bio(const char *server /* optionally includes ":port" */, static ASN1_VALUE *BIO_mem_d2i(BIO *mem, const ASN1_ITEM *it) { const unsigned char *p; - long len = BIO_get_mem_data(mem, &p); ASN1_VALUE *resp; if (mem == NULL) return NULL; - if ((resp = ASN1_item_d2i(NULL, &p, len, it)) == NULL) + if ((resp = ASN1_item_d2i(NULL, &p, BIO_get_mem_data(mem, &p), it)) == NULL) ERR_raise(ERR_LIB_HTTP, HTTP_R_RESPONSE_PARSE_ERROR); return resp; } |