]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wipefs: check errno after strto..()
authorKarel Zak <kzak@redhat.com>
Mon, 21 Jun 2021 13:34:06 +0000 (15:34 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 21 Jun 2021 13:34:06 +0000 (15:34 +0200)
Addresses: https://github.com/karelzak/util-linux/issues/1356
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/wipefs.c

index 1b265b48cf6354ce2d96089bda2b9661684c3062..78dc63ee7acec8b1512351f7274243fb8e278be1 100644 (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))