mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-03 06:47:04 -04:00
security: reject zero-channel volume in PulseAudio message parsing
read_cvolume accepted channels=0, creating a degenerate zero-length volume array that is passed to pw_stream_set_control and SPA pod building. Reject zero channels alongside the existing CHANNELS_MAX upper bound check. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
807b93fb05
commit
bc4e1a989c
1 changed files with 1 additions and 1 deletions
|
|
@ -215,7 +215,7 @@ static int read_cvolume(struct message *m, struct volume *vol)
|
||||||
|
|
||||||
if ((res = read_u8(m, &vol->channels)) < 0)
|
if ((res = read_u8(m, &vol->channels)) < 0)
|
||||||
return res;
|
return res;
|
||||||
if (vol->channels > CHANNELS_MAX)
|
if (vol->channels == 0 || vol->channels > CHANNELS_MAX)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
for (i = 0; i < vol->channels; i ++) {
|
for (i = 0; i < vol->channels; i ++) {
|
||||||
if ((res = read_volume(m, &vol->values[i])) < 0)
|
if ((res = read_volume(m, &vol->values[i])) < 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue