properties: fix value allocation

We need an extra byte for the \0
This commit is contained in:
Wim Taymans 2021-02-07 19:25:35 +01:00
parent febe8054e4
commit 746c714b0c

View file

@ -172,7 +172,7 @@ int pw_properties_update_string(struct pw_properties *props, const char *str, si
if (spa_json_is_container(value, len)) if (spa_json_is_container(value, len))
len = spa_json_container_len(&it[1], value, len); len = spa_json_container_len(&it[1], value, len);
if ((val = malloc(len)) != NULL) if ((val = malloc(len+1)) != NULL)
spa_json_parse_string(value, len, val); spa_json_parse_string(value, len, val);
} }
count += pw_properties_set(&impl->this, key, val); count += pw_properties_set(&impl->this, key, val);