mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-06 06:46:29 -04:00
rtp-sap: handle out-of-bound SAP packet read
If the SAP packet contains the MIME type string but no SDP payload after it, sdp would point past the null-terminated buffer. Check that we are still inside the packet before parsing the SDP.
This commit is contained in:
parent
d32a21c4ee
commit
364436dd31
1 changed files with 4 additions and 2 deletions
|
|
@ -1756,9 +1756,11 @@ static int parse_sap(struct impl *impl, void *data, size_t len)
|
|||
if (spa_strstartswith(mime, "v=0")) {
|
||||
sdp = mime;
|
||||
mime = SAP_MIME_TYPE;
|
||||
} else if (spa_streq(mime, SAP_MIME_TYPE))
|
||||
} else if (spa_streq(mime, SAP_MIME_TYPE)) {
|
||||
sdp = SPA_PTROFF(mime, strlen(mime)+1, char);
|
||||
else
|
||||
if (sdp >= SPA_PTROFF(data, len, char))
|
||||
return -EINVAL;
|
||||
} else
|
||||
return -EINVAL;
|
||||
|
||||
pw_log_debug("got SAP: %s %s", mime, sdp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue