json: allocate one extra byte for the \0

This commit is contained in:
Wim Taymans 2021-01-19 16:56:55 +01:00
parent f891324e25
commit 579e8a4ea6
4 changed files with 6 additions and 5 deletions

View file

@ -1616,7 +1616,7 @@ static int json_to_pod(struct spa_pod_builder *b, uint32_t id,
spa_pod_builder_none(b);
}
else {
char *val = alloca(len);
char *val = alloca(len+1);
spa_json_parse_string(value, len, val);
switch (info->parent) {
case SPA_TYPE_Id: