mirror of
https://github.com/curl/curl.git
synced 2026-05-19 06:46:20 +03:00
vtls: avoid NULL deref on bad PEM input
Spotted by Coverity Closes #17274
This commit is contained in:
parent
7b92844639
commit
3a2689712a
1 changed files with 6 additions and 3 deletions
|
|
@ -698,9 +698,12 @@ static CURLcode pubkey_pem_to_der(const char *pem,
|
|||
++pem_count;
|
||||
}
|
||||
|
||||
result = curlx_base64_decode(curlx_dyn_ptr(&pbuf), der, der_len);
|
||||
|
||||
curlx_dyn_free(&pbuf);
|
||||
if(curlx_dyn_len(&pbuf)) {
|
||||
result = curlx_base64_decode(curlx_dyn_ptr(&pbuf), der, der_len);
|
||||
curlx_dyn_free(&pbuf);
|
||||
}
|
||||
else
|
||||
result = CURLE_BAD_CONTENT_ENCODING;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue