From: Karel Zak Date: Mon, 21 Jun 2021 13:34:06 +0000 (+0200) Subject: wipefs: check errno after strto..() X-Git-Tag: v2.38-rc1~404 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95bfc92361819a4aaba528245f7077944f925087;p=thirdparty%2Futil-linux.git wipefs: check errno after strto..() Addresses: https://github.com/karelzak/util-linux/issues/1356 Signed-off-by: Karel Zak --- 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))