From: Grant Erickson Date: Thu, 28 Jun 2012 00:21:18 +0000 (-0700) Subject: main: static-qualify default config values X-Git-Tag: 2.0_alpha~32 X-Git-Url: http://review.tizen.org/git/?p=framework%2Fconnectivity%2Fconnman.git;a=commitdiff_plain;h=148062d53b9a5b1c2f6f7f008de5aca09efbe9bd 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. --- 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",