summaryrefslogtreecommitdiff
path: root/lib/rtsp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-04-11 13:17:55 +0200
committerDaniel Stenberg <daniel@haxx.se>2011-04-11 13:17:55 +0200
commitf01df1979812a1870b54ec676688137f61ab36c0 (patch)
tree6ff3ae7b9febc9a1fe768172ce5f934e926a7ebd /lib/rtsp.c
parentb2e06ea166a6c57befd9113ebcd0b4662f41a56f (diff)
downloadcurl-f01df1979812a1870b54ec676688137f61ab36c0.tar.gz
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
Diffstat (limited to 'lib/rtsp.c')
-rw-r--r--lib/rtsp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/rtsp.c b/lib/rtsp.c
index 52cf5efc7..56998c16e 100644
--- a/lib/rtsp.c
+++ b/lib/rtsp.c
@@ -124,10 +124,10 @@ bool Curl_rtsp_connisdead(struct connectdata *check)
/* socket is in an error state */
ret_val = TRUE;
}
- else if (sval & CURL_CSELECT_IN) {
- /* readable with no error. could be closed or could be alive */
- curl_socket_t connectinfo =
- Curl_getconnectinfo(check->data, &check);
+ else if ((sval & CURL_CSELECT_IN) && check->data) {
+ /* readable with no error. could be closed or could be alive but we can
+ only check if we have a proper SessionHandle for the connection */
+ curl_socket_t connectinfo = Curl_getconnectinfo(check->data, &check);
if(connectinfo != CURL_SOCKET_BAD)
ret_val = FALSE;
}