summaryrefslogtreecommitdiffstats
path: root/disk-utils/fdisk.c
diff options
context:
space:
mode:
authorKarel Zak2015-01-28 14:40:10 +0100
committerKarel Zak2015-01-28 14:40:10 +0100
commit68ddb1366215b6476fc205b4da0ed66e68998fd2 (patch)
treec358ab7c9ca92d07cad005e7e6baea65a18a4623 /disk-utils/fdisk.c
parentblockdev: check return when read from sysfs [coverity scan] (diff)
downloadkernel-qcow2-util-linux-68ddb1366215b6476fc205b4da0ed66e68998fd2.tar.gz
kernel-qcow2-util-linux-68ddb1366215b6476fc205b4da0ed66e68998fd2.tar.xz
kernel-qcow2-util-linux-68ddb1366215b6476fc205b4da0ed66e68998fd2.zip
fdisk: check return and robust label usage [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/fdisk.c')
-rw-r--r--disk-utils/fdisk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/disk-utils/fdisk.c b/disk-utils/fdisk.c
index 8807940ec..8a0bfd575 100644
--- a/disk-utils/fdisk.c
+++ b/disk-utils/fdisk.c
@@ -107,7 +107,7 @@ static int ask_menu(struct fdisk_context *cxt, struct fdisk_ask *ask,
do {
char prompt[128];
- int key, c;
+ int key, c, rc;
const char *name, *desc;
size_t i = 0;
@@ -117,7 +117,9 @@ static int ask_menu(struct fdisk_context *cxt, struct fdisk_ask *ask,
/* ask for key */
snprintf(prompt, sizeof(prompt), _("Select (default %c): "), dft);
- get_user_reply(cxt, prompt, buf, bufsz);
+ rc = get_user_reply(cxt, prompt, buf, bufsz);
+ if (rc)
+ return rc;
if (!*buf) {
fdisk_info(cxt, _("Using default response %c."), dft);
c = dft;