mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
rtp: Fix rtp_port reading.
pa_atou() return value was not checked, and the cast of a 16-bit variable pointer to a 32-bit variable pointer could corrupt cseq.
This commit is contained in:
parent
b1303e6d92
commit
82e44a9f45
1 changed files with 10 additions and 2 deletions
|
|
@ -143,9 +143,17 @@ static void headers_read(pa_rtsp_client *c) {
|
||||||
|
|
||||||
/* Now parse out the server port component of the response. */
|
/* Now parse out the server port component of the response. */
|
||||||
while ((token = pa_split(c->transport, delimiters, &token_state))) {
|
while ((token = pa_split(c->transport, delimiters, &token_state))) {
|
||||||
if ((pc = strstr(token, "="))) {
|
if ((pc = strchr(token, '='))) {
|
||||||
if (0 == strncmp(token, "server_port", 11)) {
|
if (0 == strncmp(token, "server_port", 11)) {
|
||||||
pa_atou(pc+1, (uint32_t*)(&c->rtp_port));
|
uint32_t p;
|
||||||
|
|
||||||
|
if (pa_atou(pc + 1, &p) < 0 || p <= 0 || p > 0xffff) {
|
||||||
|
pa_log("Invalid SETUP response (invalid server_port).");
|
||||||
|
pa_xfree(token);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
c->rtp_port = p;
|
||||||
pa_xfree(token);
|
pa_xfree(token);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue