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=/".
This commit is contained in:
Dave Reisner
2013-10-06 18:29:12 -04:00
parent a7176505e0
commit 1d5989fd80
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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;