Fix CID 410152 Dereference after null check (#16502)
Stelios Fragkakis committed
Nov 29, 2023 at 15:58 UTC
3e94c0a8ef5ba820c30dd45665217454cceff61f
1 file changed
+3
-1
daemon/analytics.c
+3
-1
@@ -978,8 +978,10 @@ void send_statistics(const char *action, const char *action_result, const char *
978
if (!netdata_anonymous_statistics_enabled || !action)
979
return;
980
981
- if (!action_result || !action_data)
981
+ if (!action_result)
982
action_result = "";
983
+ if (!action_data)
984
+ action_data = "";
985
986
char *command_to_run = mallocz(
987
sizeof(char) * (strlen(action) + strlen(action_result) + strlen(action_data) + strlen(as_script) +