From 148062d53b9a5b1c2f6f7f008de5aca09efbe9bd Mon Sep 17 00:00:00 2001 From: Grant Erickson Date: Wed, 27 Jun 2012 17:21:18 -0700 Subject: [PATCH] main: static-qualify default config values The default configuration arrays default_auto_connect and default_blacklist must be static-qualified. Otherwise, their stack-allocated storage will go out of scope after parse_config is finished and empty or commented-out DefaultAutoConnectTechnologies or NetworkInterfaceBlacklist config entries will refer to random stack data. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index fc3812f..a39adb3 100644 --- a/src/main.c +++ b/src/main.c @@ -141,13 +141,13 @@ static void parse_config(GKeyFile *config) char **interfaces; char **str_list; gsize len; - char *default_auto_connect[] = { + static char *default_auto_connect[] = { "wifi", "ethernet", "cellular", NULL }; - char *default_blacklist[] = { + static char *default_blacklist[] = { "vmnet", "vboxnet", "virbr", -- 2.7.4