From 95bfc92361819a4aaba528245f7077944f925087 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 21 Jun 2021 15:34:06 +0200 Subject: [PATCH] wipefs: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak --- misc-utils/wipefs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc-utils/wipefs.c b/misc-utils/wipefs.c index 1b265b48cf..78dc63ee7a 100644 --- a/misc-utils/wipefs.c +++ b/misc-utils/wipefs.c @@ -334,7 +334,10 @@ static struct wipe_desc *get_desc_for_probe(struct wipe_control *ctl, } else return NULL; + errno = 0; *offset = strtoll(off, NULL, 10); + if (errno) + return NULL; /* Filter out by -t */ if (ctl->type_pattern && !match_fstype(type, ctl->type_pattern)) -- 2.47.2