summaryrefslogtreecommitdiff
path: root/src/pulse
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-08-27 05:33:45 +0200
committerLennart Poettering <lennart@poettering.net>2009-08-27 05:33:45 +0200
commit35fcb27a81b35ca0ef2b01f19c140271970d87fe (patch)
tree040319229b297ff27dbd6de1cf5389e7ff0fedac /src/pulse
parent5df842db648d876192569e3aa6e0beace1a7ac5c (diff)
proplist: allow setting of zero-length data properties
Diffstat (limited to 'src/pulse')
-rw-r--r--src/pulse/proplist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pulse/proplist.c b/src/pulse/proplist.c
index c904f533..048b241a 100644
--- a/src/pulse/proplist.c
+++ b/src/pulse/proplist.c
@@ -251,7 +251,7 @@ int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nb
pa_assert(p);
pa_assert(key);
- pa_assert(data);
+ pa_assert(data || nbytes == 0);
if (!property_name_valid(key))
return -1;
@@ -264,7 +264,8 @@ int pa_proplist_set(pa_proplist *p, const char *key, const void *data, size_t nb
pa_xfree(prop->value);
prop->value = pa_xmalloc(nbytes+1);
- memcpy(prop->value, data, nbytes);
+ if (nbytes > 0)
+ memcpy(prop->value, data, nbytes);
((char*) prop->value)[nbytes] = 0;
prop->nbytes = nbytes;