mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-03 06:47:04 -04:00
security: validate sample rate in PulseAudio update_stream_sample_rate
The client-provided rate was used without validation. A zero or excessively large rate produces extreme correction values passed to pw_stream_set_control. Reject rates that are zero or exceed RATE_MAX. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
5f02641859
commit
cd7bb1e37d
1 changed files with 3 additions and 0 deletions
|
|
@ -4684,6 +4684,9 @@ static int do_update_stream_sample_rate(struct client *client, uint32_t command,
|
||||||
if (stream == NULL || stream->type == STREAM_TYPE_UPLOAD)
|
if (stream == NULL || stream->type == STREAM_TYPE_UPLOAD)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
|
if (rate == 0 || rate > RATE_MAX)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
stream->rate = rate;
|
stream->rate = rate;
|
||||||
|
|
||||||
corr = (float)rate/(float)stream->ss.rate;
|
corr = (float)rate/(float)stream->ss.rate;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue