mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-30 06:46:49 -04:00
security: fix unsafe atoi() on network RTSP status code
Input Validation: Medium atoi() on network-received data returns 0 on parse failure, which is indistinguishable from a valid "0" input. It also accepts negative values and does not detect overflow. Replace with strtol() and validate that the status code is in the valid HTTP/RTSP range (100-599) to prevent protocol state confusion from malformed responses. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ca0fa1e4e1
commit
9b845f4415
1 changed files with 2 additions and 2 deletions
|
|
@ -253,8 +253,8 @@ static int process_status(struct pw_rtsp_client *client, char *buf)
|
|||
if (s == NULL)
|
||||
return -EPROTO;
|
||||
|
||||
client->status = atoi(s);
|
||||
if (client->status == 0)
|
||||
client->status = strtol(s, NULL, 10);
|
||||
if (client->status < 100 || client->status > 599)
|
||||
return -EPROTO;
|
||||
|
||||
s = pw_split_walk(buf, " ", &len, &state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue