mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:21:41 +03:00
socks: make Curl_blockread_all return CURLcode
Reported in Joshua's sarif data Closes #18635
This commit is contained in:
parent
ca75476a5c
commit
2a5da01e42
3 changed files with 36 additions and 34 deletions
|
|
@ -72,7 +72,6 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
|
|||
size_t actualread;
|
||||
size_t written;
|
||||
CURLcode result;
|
||||
int err;
|
||||
/* Needs GSS-API authentication */
|
||||
SECURITY_STATUS status;
|
||||
unsigned long sspi_ret_flags = 0;
|
||||
|
|
@ -237,10 +236,11 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
|
|||
* +----+------+-----+----------------+
|
||||
*/
|
||||
|
||||
err = Curl_blockread_all(cf, data, (char *)socksreq, 4, &actualread);
|
||||
if(err || (actualread != 4)) {
|
||||
result = Curl_blockread_all(cf, data, (char *)socksreq, 4, &actualread);
|
||||
if(result || (actualread != 4)) {
|
||||
failf(data, "Failed to receive SSPI authentication response.");
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
if(!result)
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
@ -269,12 +269,13 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
|
|||
result = CURLE_OUT_OF_MEMORY;
|
||||
goto error;
|
||||
}
|
||||
err = Curl_blockread_all(cf, data, (char *)sspi_recv_token.pvBuffer,
|
||||
sspi_recv_token.cbBuffer, &actualread);
|
||||
result = Curl_blockread_all(cf, data, (char *)sspi_recv_token.pvBuffer,
|
||||
sspi_recv_token.cbBuffer, &actualread);
|
||||
|
||||
if(err || (actualread != us_length)) {
|
||||
if(result || (actualread != us_length)) {
|
||||
failf(data, "Failed to receive SSPI authentication token.");
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
if(!result)
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
@ -453,10 +454,11 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
|
|||
Curl_safefree(etbuf);
|
||||
}
|
||||
|
||||
err = Curl_blockread_all(cf, data, (char *)socksreq, 4, &actualread);
|
||||
if(err || (actualread != 4)) {
|
||||
result = Curl_blockread_all(cf, data, (char *)socksreq, 4, &actualread);
|
||||
if(result || (actualread != 4)) {
|
||||
failf(data, "Failed to receive SSPI encryption response.");
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
if(!result)
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
@ -485,12 +487,13 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(struct Curl_cfilter *cf,
|
|||
goto error;
|
||||
}
|
||||
|
||||
err = Curl_blockread_all(cf, data, (char *)sspi_w_token[0].pvBuffer,
|
||||
sspi_w_token[0].cbBuffer, &actualread);
|
||||
result = Curl_blockread_all(cf, data, (char *)sspi_w_token[0].pvBuffer,
|
||||
sspi_w_token[0].cbBuffer, &actualread);
|
||||
|
||||
if(err || (actualread != us_length)) {
|
||||
if(result || (actualread != us_length)) {
|
||||
failf(data, "Failed to receive SSPI encryption type.");
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
if(!result)
|
||||
result = CURLE_COULDNT_CONNECT;
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue