checkconnection: don't call with NULL pointer

When checking if an existing RTSP connection is alive or not, the
checkconnection function might be called with a SessionHandle pointer
being NULL and then referenced causing a crash. This happened only using
the multi interface.

Reported by: Tinus van den Berg

Bug: http://curl.haxx.se/bug/view.cgi?id=3280739
This commit is contained in:
Daniel Stenberg
2011-04-11 13:17:55 +02:00
parent b2e06ea166
commit f01df19798
2 changed files with 7 additions and 4 deletions

View File

@@ -1122,6 +1122,9 @@ curl_socket_t Curl_getconnectinfo(struct SessionHandle *data,
struct connectdata **connp)
{
curl_socket_t sockfd;
DEBUGASSERT(data);
if((data->state.lastconnect != -1) &&
(data->state.connc->connects[data->state.lastconnect] != NULL)) {
struct connectdata *c =