mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-31 22:25:33 -04:00
rtp: Introduce pa_rtsp_exec_ready()
In the current RTSP implementation, there is a vulnerable window between the RTSP object creation and the URL initialization. If any RTSP command is issued during this period, it will lead to crash by assertion violation. This patch introduces pa_rtsp_exec_ready(), which returns if it is safe to issue RTSP commands. Reviewed-by: Anton Lundin <glance@acc.umu.se>
This commit is contained in:
parent
60a1c27517
commit
19873dff0a
2 changed files with 8 additions and 0 deletions
|
|
@ -389,6 +389,12 @@ void pa_rtsp_remove_header(pa_rtsp_client *c, const char *key) {
|
|||
pa_headerlist_remove(c->headers, key);
|
||||
}
|
||||
|
||||
bool pa_rtsp_exec_ready(const pa_rtsp_client *c) {
|
||||
pa_assert(c);
|
||||
|
||||
return c->url != NULL && c->ioline != NULL;
|
||||
}
|
||||
|
||||
static int rtsp_exec(pa_rtsp_client *c, const char *cmd,
|
||||
const char *content_type, const char *content,
|
||||
int expect_response,
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ void pa_rtsp_set_url(pa_rtsp_client *c, const char *url);
|
|||
void pa_rtsp_add_header(pa_rtsp_client *c, const char *key, const char *value);
|
||||
void pa_rtsp_remove_header(pa_rtsp_client *c, const char *key);
|
||||
|
||||
bool pa_rtsp_exec_ready(const pa_rtsp_client *c);
|
||||
|
||||
int pa_rtsp_options(pa_rtsp_client *c);
|
||||
int pa_rtsp_announce(pa_rtsp_client *c, const char *sdp);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue