mirror of
https://github.com/curl/curl.git
synced 2026-05-30 11:27:29 +03:00
schannel: cap the maximum allowed size for loading cert
To avoid problems with mistakes or abuse, cap the largest allowed certificate size to load to CURL_MAX_INPUT_LENGTH bytes (8MB). Closes #19964
This commit is contained in:
parent
f0d277cb0e
commit
1c8c34c88e
1 changed files with 1 additions and 1 deletions
|
|
@ -588,7 +588,7 @@ static CURLcode schannel_acquire_credential_handle(struct Curl_cfilter *cf,
|
|||
certsize = (size_t)cert_tell;
|
||||
if(continue_reading)
|
||||
continue_reading = fseek(fInCert, 0, SEEK_SET) == 0;
|
||||
if(continue_reading)
|
||||
if(continue_reading && (certsize < CURL_MAX_INPUT_LENGTH))
|
||||
certdata = curlx_malloc(certsize + 1);
|
||||
if((!certdata) ||
|
||||
((int) fread(certdata, certsize, 1, fInCert) != 1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue