summaryrefslogtreecommitdiff
path: root/libblkid
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2013-05-06 17:20:03 +0200
committerKarel Zak <kzak@redhat.com>2013-05-06 17:20:03 +0200
commitaab691cf8deb4a53782a0317b6f96c5d8b61f8e9 (patch)
tree588bb4e2072ab57b63a3d5e190edbd00bcd1b5b1 /libblkid
parenta48c321dd175d043fb4572bab625631b2055075e (diff)
downloadutil-linux-aab691cf8deb4a53782a0317b6f96c5d8b61f8e9.tar.gz
libblkid: fix blkid_parse_tag_string() to ignore incomplete tags
fstab entry: FOO= / btrfs defaults 1 1 Program received signal SIGABRT, Aborted. 0x00007f016ccd8819 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 56 return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig); (gdb) bt at ../sysdeps/unix/sysv/linux/libc_fatal.c:196 Reported-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid')
-rw-r--r--libblkid/src/tag.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libblkid/src/tag.c b/libblkid/src/tag.c
index 9cfd6176..3a709501 100644
--- a/libblkid/src/tag.c
+++ b/libblkid/src/tag.c
@@ -237,8 +237,7 @@ int blkid_parse_tag_string(const char *token, char **ret_type, char **ret_val)
goto errout; /* missing closing quote */
*cp = '\0';
}
- if (value && *value)
- value = strdup(value);
+ value = value && *value ? strdup(value) : NULL;
if (!value)
goto errout;
@@ -250,6 +249,7 @@ int blkid_parse_tag_string(const char *token, char **ret_type, char **ret_val)
return 0;
errout:
+ DBG(TAG, blkid_debug("parse error: '%s'", token));
free(name);
return -1;
}