mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pod: ensure strings are NUL-terminated before calling strlen()
SPA_TYPE_String needs to be NUL-terminated, so check that in spa_pod_compare_value().
This commit is contained in:
parent
5bfc3e6b03
commit
7ac94f1a69
1 changed files with 3 additions and 1 deletions
|
|
@ -63,7 +63,9 @@ SPA_API_POD_COMPARE int spa_pod_compare_value(uint32_t type, const void *r1, con
|
|||
return -EINVAL;
|
||||
return SPA_CMP(*(double *)r1, *(double *)r2);
|
||||
case SPA_TYPE_String:
|
||||
if (size < sizeof(char))
|
||||
if (size < sizeof(char) ||
|
||||
((char *)r1)[size - 1] ||
|
||||
((char *)r2)[size - 1])
|
||||
return -EINVAL;
|
||||
return strcmp((char *)r1, (char *)r2);
|
||||
case SPA_TYPE_Rectangle:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue