From: Karel Zak Date: Thu, 21 Jun 2012 10:54:31 +0000 (+0200) Subject: swaplabel: check blkid_probe_lookup_value() result [coverity scan] X-Git-Tag: v2.22-rc1~243 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b21a6b9f3c8b945f18fab50ae0586c0053e9d89;p=thirdparty%2Futil-linux.git swaplabel: check blkid_probe_lookup_value() result [coverity scan] Signed-off-by: Karel Zak --- diff --git a/disk-utils/swaplabel.c b/disk-utils/swaplabel.c index bf4ee71c2d..44b1cb368e 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