From: Jonas Holmberg Date: Thu, 19 Sep 2013 13:44:26 +0000 (+0200) Subject: client: Do not read beyond end of path string X-Git-Tag: 1.19.3~495^2~973 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e88b71aee4ad51f0a7a8af21d467211cac0d8aa6;p=platform%2Fupstream%2Fgstreamer.git client: Do not read beyond end of path string If the setup was done without a control url, make sure we don't try to read the non-existing control string and crash. --- diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index b7f430c..1d192a7 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -1425,6 +1425,9 @@ handle_setup_request (GstRTSPClient * client, GstRTSPContext * ctx) if (media == NULL) goto media_not_found; + if (path[matched] == '\0') + goto control_not_found; + /* path is what matched. We can modify the parsed uri in place */ path[matched] = '\0'; /* control is remainder */ @@ -1551,6 +1554,13 @@ media_not_found: send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); return FALSE; } +control_not_found: + { + GST_ERROR ("client %p: no control in path '%s'", client, path); + send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx); + g_object_unref (media); + return FALSE; + } stream_not_found: { GST_ERROR ("client %p: stream '%s' not found", client, control);