mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
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.
This commit is contained in:
parent
b41422bad7
commit
e88b71aee4
1 changed files with 10 additions and 0 deletions
|
@ -1425,6 +1425,9 @@ handle_setup_request (GstRTSPClient * client, GstRTSPContext * ctx)
|
||||||
if (media == NULL)
|
if (media == NULL)
|
||||||
goto media_not_found;
|
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 is what matched. We can modify the parsed uri in place */
|
||||||
path[matched] = '\0';
|
path[matched] = '\0';
|
||||||
/* control is remainder */
|
/* control is remainder */
|
||||||
|
@ -1551,6 +1554,13 @@ media_not_found:
|
||||||
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx);
|
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, ctx);
|
||||||
return FALSE;
|
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:
|
stream_not_found:
|
||||||
{
|
{
|
||||||
GST_ERROR ("client %p: stream '%s' not found", client, control);
|
GST_ERROR ("client %p: stream '%s' not found", client, control);
|
||||||
|
|
Loading…
Reference in a new issue