]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ipmaddr: Avoid accessing uninitialized data
authorPhil Sutter <phil@nwl.cc>
Mon, 21 Aug 2017 09:27:01 +0000 (11:27 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 22 Aug 2017 00:17:00 +0000 (17:17 -0700)
Looks like this can only happen if /proc/net/igmp is malformed, but
better be sure.

Signed-off-by: Phil Sutter <phil@nwl.cc>
ip/ipmaddr.c

index 4f726fdd976f1363b4392c3d7008b61d9a68c7ca..85a69e779563ddc0696a56171328ae3e76c44360 100644 (file)
@@ -136,7 +136,7 @@ static void read_igmp(struct ma_info **result_p)
 
        while (fgets(buf, sizeof(buf), fp)) {
                struct ma_info *ma;
-               size_t len;
+               size_t len = 0;
 
                if (buf[0] != '\t') {
                        sscanf(buf, "%d%s", &m.index, m.name);