From 6b21a6b9f3c8b945f18fab50ae0586c0053e9d89 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 21 Jun 2012 12:54:31 +0200 Subject: swaplabel: check blkid_probe_lookup_value() result [coverity scan] Signed-off-by: Karel Zak --- disk-utils/swaplabel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'disk-utils/swaplabel.c') diff --git a/disk-utils/swaplabel.c b/disk-utils/swaplabel.c index bf4ee71c2..44b1cb368 100644 --- a/disk-utils/swaplabel.c +++ b/disk-utils/swaplabel.c @@ -68,8 +68,9 @@ static blkid_probe get_swap_prober(const char *devname) if (rc == 0) { /* supported is SWAPSPACE2 only */ - blkid_probe_lookup_value(pr, "VERSION", &version, NULL); - if (strcmp(version, "2")) + if (blkid_probe_lookup_value(pr, "VERSION", &version, NULL) == 0 + && version + && strcmp(version, "2")) warnx(_("%s: unsupported swap version '%s'"), devname, version); else -- cgit v1.2.3-55-g7522