mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
json: allocate one extra byte for the \0
This commit is contained in:
parent
f891324e25
commit
579e8a4ea6
4 changed files with 6 additions and 5 deletions
|
|
@ -71,7 +71,7 @@ static void expect_string(struct spa_json *it, const char *str)
|
|||
char *s;
|
||||
spa_assert((len = spa_json_next(it, &value)) > 0);
|
||||
check_type(TYPE_STRING, value, len);
|
||||
s = alloca(len);
|
||||
s = alloca(len+1);
|
||||
spa_json_parse_string(value, len, s);
|
||||
spa_assert(strcmp(s, str) == 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue