summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2013-10-06 18:26:23 -0400
committerDave Reisner <dreisner@archlinux.org>2013-10-06 18:29:12 -0400
commit1d5989fd803d2019de0f6aaaf3cfb1cb2bbc3cdb (patch)
tree143afd0a3a1b7075ac876a50f7b69cd051a7b465 /src/shared
parenta7176505e0083a073d03760f7b5435017a47c7c8 (diff)
shared/util: fix off-by-one error in tag_to_udev_node
Triggered false negatives when encoding a string which needed every character to be escaped, e.g. "LABEL=/".
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 82f4221f30..31cea79f8b 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -3527,7 +3527,7 @@ static char *tag_to_udev_node(const char *tagvalue, const char *by) {
if (u == NULL)
return NULL;
- enc_len = strlen(u) * 4;
+ enc_len = strlen(u) * 4 + 1;
t = new(char, enc_len);
if (t == NULL)
return NULL;