security: add missing create_tag check in update_stream_sample_rate

If a client sends UPDATE_PLAYBACK_STREAM_SAMPLE_RATE before format
negotiation completes, stream->ss.rate could be 0, causing a
floating-point division by zero. Add the same create_tag guard used
in do_set_stream_buffer_attr.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Wim Taymans 2026-04-29 18:20:04 +02:00
parent 890c06117a
commit 8e7ca70352

View file

@ -4685,6 +4685,8 @@ static int do_update_stream_sample_rate(struct client *client, uint32_t command,
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;
if (rate == 0 || rate > RATE_MAX)
return -EINVAL;