mirror of
https://github.com/curl/curl.git
synced 2025-09-17 09:32:48 +03:00
urldata: make 'buffer_size' an unsigned int
It is already capped at READBUFFER_MAX which fits easily in 32 bits. Closes #9098
This commit is contained in:
parent
cb17b12b01
commit
3fa343a35c
|
@ -398,7 +398,8 @@ CURLcode Curl_pp_readresp(struct Curl_easy *data,
|
||||||
}
|
}
|
||||||
else if(keepon) {
|
else if(keepon) {
|
||||||
|
|
||||||
if((perline == gotbytes) && (gotbytes > data->set.buffer_size/2)) {
|
if((perline == gotbytes) &&
|
||||||
|
(gotbytes > (ssize_t)data->set.buffer_size/2)) {
|
||||||
/* We got an excessive line without newlines and we need to deal
|
/* We got an excessive line without newlines and we need to deal
|
||||||
with it. We keep the first bytes of the line then we throw
|
with it. We keep the first bytes of the line then we throw
|
||||||
away the rest. */
|
away the rest. */
|
||||||
|
|
|
@ -2238,7 +2238,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
||||||
else if(arg < READBUFFER_MIN)
|
else if(arg < READBUFFER_MIN)
|
||||||
arg = READBUFFER_MIN;
|
arg = READBUFFER_MIN;
|
||||||
|
|
||||||
data->set.buffer_size = arg;
|
data->set.buffer_size = (int)arg;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CURLOPT_UPLOAD_BUFFERSIZE:
|
case CURLOPT_UPLOAD_BUFFERSIZE:
|
||||||
|
|
|
@ -1744,7 +1744,7 @@ struct UserDefined {
|
||||||
#endif
|
#endif
|
||||||
struct ssl_general_config general_ssl; /* general user defined SSL stuff */
|
struct ssl_general_config general_ssl; /* general user defined SSL stuff */
|
||||||
int dns_cache_timeout; /* DNS cache timeout (seconds) */
|
int dns_cache_timeout; /* DNS cache timeout (seconds) */
|
||||||
long buffer_size; /* size of receive buffer to use */
|
unsigned int buffer_size; /* size of receive buffer to use */
|
||||||
unsigned int upload_buffer_size; /* size of upload buffer to use,
|
unsigned int upload_buffer_size; /* size of upload buffer to use,
|
||||||
keep it >= CURL_MAX_WRITE_SIZE */
|
keep it >= CURL_MAX_WRITE_SIZE */
|
||||||
void *private_data; /* application-private data */
|
void *private_data; /* application-private data */
|
||||||
|
|
|
@ -899,7 +899,7 @@ char *Curl_ssl_snihost(struct Curl_easy *data, const char *host, size_t *olen)
|
||||||
size_t len = strlen(host);
|
size_t len = strlen(host);
|
||||||
if(len && (host[len-1] == '.'))
|
if(len && (host[len-1] == '.'))
|
||||||
len--;
|
len--;
|
||||||
if((long)len >= data->set.buffer_size)
|
if(len >= data->set.buffer_size)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Curl_strntolower(data->state.buffer, host, len);
|
Curl_strntolower(data->state.buffer, host, len);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user