summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-04-06 23:50:39 +0200
committerMartin Pitt <martin.pitt@ubuntu.com>2016-04-06 23:50:39 +0200
commit817ec8cc819787240efda834483d8a7a512d2933 (patch)
treec1c5e422ef582338d4f0040279f3ec3603cc8889
parentbf8f7583ee2a6f93ede82c97d6b47f1f4a7245db (diff)
sd-device: Allocate enough room for tags string
Fix commit 1d88a2: We need to allocate another byte for building the "tags" string, as we append an extra ':' and still need the NUL terminator.
-rw-r--r--src/libsystemd/sd-device/sd-device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index e9f8970d2c..e787cb69d3 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -1492,7 +1492,7 @@ static int device_properties_prepare(sd_device *device) {
for (tag = sd_device_get_tag_first(device); tag; tag = sd_device_get_tag_next(device)) {
char *e;
- if (!GREEDY_REALLOC(tags, tags_allocated, tags_len + strlen(tag) + 1))
+ if (!GREEDY_REALLOC(tags, tags_allocated, tags_len + strlen(tag) + 2))
return -ENOMEM;
e = stpcpy(stpcpy(tags + tags_len, tag), ":");
tags_len = e - tags;