From 746c714b0c08f2d230f2d783d2943dd84306636d Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 7 Feb 2021 19:25:35 +0100 Subject: [PATCH] properties: fix value allocation We need an extra byte for the \0 --- src/pipewire/properties.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipewire/properties.c b/src/pipewire/properties.c index 46b69d216..c57df300e 100644 --- a/src/pipewire/properties.c +++ b/src/pipewire/properties.c @@ -172,7 +172,7 @@ int pw_properties_update_string(struct pw_properties *props, const char *str, si if (spa_json_is_container(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); } count += pw_properties_set(&impl->this, key, val);