]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: ignore scanf() result when read number of stripes [coverity scan]
authorKarel Zak <kzak@redhat.com>
Mon, 29 Nov 2021 14:21:55 +0000 (15:21 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 29 Nov 2021 14:21:55 +0000 (15:21 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/topology/lvm.c

index 8b0c0feea979d9f9d3468d867844d773f1da4841..6ab7a5019e12218e9374909ec3f9cb53cf9b30af 100644 (file)
@@ -107,10 +107,10 @@ static int probe_lvm_tp(blkid_probe pr,
 
        while (fgets(buf, sizeof(buf), stream) != NULL) {
                if (!strncmp(buf, "Stripes", 7))
-                       sscanf(buf, "Stripes %d", &stripes);
+                       ignore_result( sscanf(buf, "Stripes %d", &stripes) );
 
                if (!strncmp(buf, "Stripe size", 11))
-                       sscanf(buf, "Stripe size (KByte) %d", &stripesize);
+                       ignore_result( sscanf(buf, "Stripe size (KByte) %d", &stripesize) );
        }
 
        if (!stripes)