mirror of
https://github.com/curl/curl.git
synced 2026-08-02 07:30:29 +03:00
schannel: fix error check logic in get_client_cert() file reader
Reported by GitHub Code Quality
Follow-up to 0fdf965126 #5193
Closes #22415
This commit is contained in:
parent
75404bda1a
commit
1386135d1c
1 changed files with 6 additions and 5 deletions
|
|
@ -441,12 +441,13 @@ static CURLcode get_client_cert(struct Curl_cfilter *cf,
|
|||
if(fInCert) {
|
||||
long cert_tell = 0;
|
||||
bool continue_reading = fseek(fInCert, 0, SEEK_END) == 0;
|
||||
if(continue_reading)
|
||||
if(continue_reading) {
|
||||
cert_tell = ftell(fInCert);
|
||||
if(cert_tell < 0)
|
||||
continue_reading = FALSE;
|
||||
else
|
||||
certsize = (size_t)cert_tell;
|
||||
if(cert_tell < 0)
|
||||
continue_reading = FALSE;
|
||||
else
|
||||
certsize = (size_t)cert_tell;
|
||||
}
|
||||
if(continue_reading)
|
||||
continue_reading = fseek(fInCert, 0, SEEK_SET) == 0;
|
||||
if(continue_reading && (certsize < CURL_MAX_INPUT_LENGTH))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue