]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ipaddress: Avoid accessing uninitialized variable lcl
authorPhil Sutter <phil@nwl.cc>
Mon, 21 Aug 2017 09:26:59 +0000 (11:26 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Tue, 22 Aug 2017 00:17:00 +0000 (17:17 -0700)
If no address was given, ipaddr_modify() accesses uninitialized data
when assigning to req.ifa.ifa_prefixlen.

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

index 4d37c5e045071341e35053dba1f1ae35ac8a301a..c9312f06dbd4d0e1be2adcd0f27ee1c62fcd8861 100644 (file)
@@ -1888,7 +1888,7 @@ static int ipaddr_modify(int cmd, int flags, int argc, char **argv)
        char  *lcl_arg = NULL;
        char  *valid_lftp = NULL;
        char  *preferred_lftp = NULL;
-       inet_prefix lcl;
+       inet_prefix lcl = {};
        inet_prefix peer;
        int local_len = 0;
        int peer_len = 0;