mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05: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
|
|
@ -117,6 +117,9 @@ SPA_API_POD_COMPARE int spa_pod_compare(const struct spa_pod *pod1,
|
|||
if (pod1->type != pod2->type)
|
||||
return -EINVAL;
|
||||
|
||||
if (n_vals1 < 1)
|
||||
return -EINVAL; /* empty choice */
|
||||
|
||||
switch (pod1->type) {
|
||||
case SPA_TYPE_Struct:
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue