mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-29 21:37:54 -04:00
security: add missing create_tag checks in stream command handlers
do_cork_stream, do_flush_trigger_prebuf_stream, and do_set_stream_name did not check whether the stream had completed format negotiation. Add create_tag guards matching the pattern in do_set_stream_buffer_attr. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
a36849189d
commit
886be20b29
1 changed files with 6 additions and 0 deletions
|
|
@ -2690,6 +2690,8 @@ static int do_cork_stream(struct client *client, uint32_t command, uint32_t tag,
|
|||
stream = pw_map_lookup(&client->streams, channel);
|
||||
if (stream == NULL || stream->type == STREAM_TYPE_UPLOAD)
|
||||
return -ENOENT;
|
||||
if (stream->create_tag != SPA_ID_INVALID)
|
||||
return -ENOENT;
|
||||
|
||||
stream_set_corked(stream, cork);
|
||||
if (cork) {
|
||||
|
|
@ -2720,6 +2722,8 @@ static int do_flush_trigger_prebuf_stream(struct client *client, uint32_t comman
|
|||
stream = pw_map_lookup(&client->streams, channel);
|
||||
if (stream == NULL || stream->type == STREAM_TYPE_UPLOAD)
|
||||
return -ENOENT;
|
||||
if (stream->create_tag != SPA_ID_INVALID)
|
||||
return -ENOENT;
|
||||
|
||||
switch (command) {
|
||||
case COMMAND_FLUSH_PLAYBACK_STREAM:
|
||||
|
|
@ -3219,6 +3223,8 @@ static int do_set_stream_name(struct client *client, uint32_t command, uint32_t
|
|||
stream = pw_map_lookup(&client->streams, channel);
|
||||
if (stream == NULL || stream->type == STREAM_TYPE_UPLOAD)
|
||||
return -ENOENT;
|
||||
if (stream->create_tag != SPA_ID_INVALID)
|
||||
return -ENOENT;
|
||||
|
||||
items[0] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_NAME, name);
|
||||
pw_stream_update_properties(stream->stream,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue