From: Karel Zak Date: Wed, 15 Jan 2020 11:35:38 +0000 (+0100) Subject: sfdisk: check fdisk_script_set_header() return code [coverity scan] X-Git-Tag: v2.35~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e1d7c65a5c707cd67ae354db4355b639fe7f1436;p=thirdparty%2Futil-linux.git sfdisk: check fdisk_script_set_header() return code [coverity scan] Signed-off-by: Karel Zak --- diff --git a/disk-utils/sfdisk.c b/disk-utils/sfdisk.c index 96b911e745..34e57221d1 100644 --- a/disk-utils/sfdisk.c +++ b/disk-utils/sfdisk.c @@ -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)