]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
unshare: call getline() in more robust way
authorKarel Zak <kzak@redhat.com>
Mon, 14 Feb 2022 12:00:36 +0000 (13:00 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 14 Feb 2022 12:00:36 +0000 (13:00 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/unshare.c

index b8173b4fe45d7e17c268be97ae1eefcc2e7eaabc..19357d478e1e58f46f99d4d84dfd925abbd5b68e 100644 (file)
@@ -430,7 +430,7 @@ static struct map_range *read_subid_range(char *filename, uid_t uid)
 {
        char *line = NULL, *pwbuf;
        FILE *idmap;
-       size_t n;
+       size_t n = 0;
        struct passwd *pw;
        struct map_range *map;