]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: check blkid_probe_set_magic() return in GPT code [coverity scan]
authorKarel Zak <kzak@redhat.com>
Tue, 31 Jan 2012 12:30:03 +0000 (13:30 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 31 Jan 2012 12:30:03 +0000 (13:30 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/partitions/gpt.c

index 0e44f6e8294ca24ce725c82551c7b2ef0f86f66d..a4838d84be999070048cdf337e9630b7ad07d636 100644 (file)
@@ -315,9 +315,10 @@ static int probe_gpt_pt(blkid_probe pr,
 
        blkid_probe_use_wiper(pr, lba * blkid_probe_get_size(pr), 8);
 
-       blkid_probe_set_magic(pr, lba << 9,
+       if (blkid_probe_set_magic(pr, lba << 9,
                              sizeof(GPT_HEADER_SIGNATURE_STR) - 1,
-                             (unsigned char *) GPT_HEADER_SIGNATURE_STR);
+                             (unsigned char *) GPT_HEADER_SIGNATURE_STR))
+               goto err;
 
        if (blkid_partitions_need_typeonly(pr))
                /* caller does not ask for details about partitions */