mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-03-26 07:58:03 -04:00
pod: check that choices are not empty
Before using the contents of a choice, check that it is not empty to avoid reading out of bounds.
This commit is contained in:
parent
d37bdf5cbf
commit
b04da87e38
7 changed files with 18 additions and 4 deletions
|
|
@ -72,7 +72,7 @@ spa_pod_simplify_merge(struct spa_pod_builder *b, const struct spa_pod *pod1, co
|
|||
vals1 = spa_pod_get_values(&p1->value, &n_vals1, &choice1);
|
||||
vals2 = spa_pod_get_values(&p2->value, &n_vals2, &choice2);
|
||||
|
||||
if (vals1->type != vals2->type)
|
||||
if (vals1->type != vals2->type || n_vals1 < 1 || n_vals2 < 1)
|
||||
goto error_einval;
|
||||
|
||||
size = vals1->size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue