diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-08-27 05:33:45 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-08-27 05:33:45 +0200 |
commit | 35fcb27a81b35ca0ef2b01f19c140271970d87fe (patch) | |
tree | 040319229b297ff27dbd6de1cf5389e7ff0fedac /src/pulse | |
parent | 5df842db648d876192569e3aa6e0beace1a7ac5c (diff) |
proplist: allow setting of zero-length data properties
Diffstat (limited to 'src/pulse')
-rw-r--r-- | src/pulse/proplist.c | 5 |
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; |