mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 02:10:17 +01:00
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 4bdd83127d)
This commit is contained in:
parent
8a17a5cf5b
commit
c14d41377a
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue