From 4bdd83127d28f422d23b15ef0ccb65522c7e2b0c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 4 May 2015 15:38:28 +0200 Subject: [PATCH] route-manager/test: fix missing initialization of temporary variables on stack Up to now, this code was correct. Later we will add another field to NMPlatformIP4Route which causes the test to operate on uninitialized data. Instead of explicitly initializing the field, just clear the whole struct. --- src/tests/test-route-manager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/test-route-manager.c b/src/tests/test-route-manager.c index f7b37a3b4a..c7b60e68e0 100644 --- a/src/tests/test-route-manager.c +++ b/src/tests/test-route-manager.c @@ -39,7 +39,7 @@ static void setup_dev0_ip4 (int ifindex, guint mss_of_first_route, guint32 metric_of_second_route) { GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route)); - NMPlatformIP4Route route; + NMPlatformIP4Route route = { 0 }; route.ifindex = ifindex; route.mss = 0; @@ -68,7 +68,7 @@ static void setup_dev1_ip4 (int ifindex) { GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route)); - NMPlatformIP4Route route; + NMPlatformIP4Route route = { 0 }; route.ifindex = ifindex; route.mss = 0; @@ -114,7 +114,7 @@ static void update_dev0_ip4 (int ifindex) { GArray *routes = g_array_new (FALSE, FALSE, sizeof (NMPlatformIP4Route)); - NMPlatformIP4Route route; + NMPlatformIP4Route route = { 0 }; route.ifindex = ifindex; route.mss = 0;