From c14d41377a6d23b2f21eaefce15a7c45f24c5801 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. (cherry picked from commit 4bdd83127d28f422d23b15ef0ccb65522c7e2b0c) --- 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 bb8b50dec3..c57bcd365c 100644 --- a/src/tests/test-route-manager.c +++ b/src/tests/test-route-manager.c @@ -40,7 +40,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; @@ -69,7 +69,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; @@ -115,7 +115,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;