From 68ddb1366215b6476fc205b4da0ed66e68998fd2 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 28 Jan 2015 14:40:10 +0100 Subject: fdisk: check return and robust label usage [coverity scan] Signed-off-by: Karel Zak --- disk-utils/fdisk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'disk-utils/fdisk.c') 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; -- cgit v1.2.3-55-g7522