@cryptotaxi247 / netdata-1 / commits / 6c2123ccf

prevent NULL dereference when host tags are not set

Costa Tsaousis (ktsaou) committed Jun 17, 2017 at 22:29 UTC 6c2123ccf0054c764ef1e115e55bbee1a9a91b1d
1 file changed +2 -1
src/rrdpush.c
+2 -1
@@ -546,7 +546,8 @@ static int rrdpush_receive(int fd, const char *key, const char *hostname, const
546 rrdpush_api_key = appconfig_get(&stream_config, key, "default proxy api key", rrdpush_api_key);
547 rrdpush_api_key = appconfig_get(&stream_config, machine_guid, "proxy api key", rrdpush_api_key);
548
549 - tags = appconfig_get(&stream_config, machine_guid, "host tags", tags);
549 + tags = appconfig_get(&stream_config, machine_guid, "host tags", (tags)?tags:"");
550 + if(tags && !*tags) tags = NULL;
551
552 if(!strcmp(machine_guid, "localhost"))
553 host = localhost;