]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: check fdisk_script_set_header() return code [coverity scan]
authorKarel Zak <kzak@redhat.com>
Wed, 15 Jan 2020 11:35:38 +0000 (12:35 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 15 Jan 2020 11:35:38 +0000 (12:35 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/sfdisk.c

index 96b911e745850b229c6151b11fc2da05c659111b..34e57221d1b78b04c18d692cde0ba28c7f1e725e 100644 (file)
@@ -1732,8 +1732,8 @@ static int command_fdisk(struct sfdisk *sf, int argc, char **argv)
        else
                label = "dos";  /* just for backward compatibility */
 
-       fdisk_script_set_header(dp, "label", label);
-
+       if (fdisk_script_set_header(dp, "label", label) != 0)
+               errx(EXIT_FAILURE, _("failed to set script header"));
 
        if (!sf->quiet && sf->interactive) {
                if (!fdisk_has_label(sf->cxt) && !sf->label)