wipefs: check errno after strto..()

Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2021-06-21 15:34:06 +02:00
parent 93d01a6233
commit 95bfc92361
1 changed files with 3 additions and 0 deletions

View File

@ -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 <type> */
if (ctl->type_pattern && !match_fstype(type, ctl->type_pattern))