Skip to content
Snippets Groups Projects
Commit 30639ed7 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Kjetil Jacobsen found out that setting CURLOPT_MAXCONNECTS to a value higher

than 5 could cause a segfault.
parent 9d02a39e
No related branches found
No related tags found
No related merge requests found
......@@ -378,12 +378,19 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...)
Curl_disconnect(data->state.connects[i]);
}
if(newconnects) {
int i;
newptr= (struct connectdata **)
realloc(data->state.connects,
sizeof(struct connectdata *) * newconnects);
if(!newptr)
/* we closed a few connections in vain, but so what? */
return CURLE_OUT_OF_MEMORY;
/* nullify the newly added pointers */
for(i=data->state.numconnects; i<newconnects; i++) {
newptr[i] = NULL;
}
data->state.connects = newptr;
data->state.numconnects = newconnects;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment