@cryptotaxi247 / netdata-1 / commits / 944003c6a

escape also alarms info strings

Costa Tsaousis (ktsaou) committed Jan 29, 2018 at 23:19 UTC 944003c6a08080a6020ab98ec13d8a6fdeb63c3c
1 file changed +2 -2
src/health_json.c
+2 -2
@@ -31,7 +31,6 @@ static inline void health_alarm_entry2json_nolock(BUFFER *wb, ALARM_ENTRY *ae, R
31 "\t\t\"exec_code\": %d,\n"
32 "\t\t\"source\": \"%s\",\n"
33 "\t\t\"units\": \"%s\",\n"
34 - "\t\t\"info\": \"%s\",\n"
34 "\t\t\"when\": %lu,\n"
35 "\t\t\"duration\": %lu,\n"
36 "\t\t\"non_clear_duration\": %lu,\n"
@@ -59,7 +58,6 @@ static inline void health_alarm_entry2json_nolock(BUFFER *wb, ALARM_ENTRY *ae, R
58 , ae->exec_code
59 , ae->source
60 , ae->units?ae->units:""
62 - , ae->info?ae->info:""
61 , (unsigned long)ae->when
62 , (unsigned long)ae->duration
63 , (unsigned long)ae->non_clear_duration
@@ -73,6 +71,8 @@ static inline void health_alarm_entry2json_nolock(BUFFER *wb, ALARM_ENTRY *ae, R
71 , ae->old_value_string
72 );
73
74 + health_string2json(wb, "\t\t", "info", ae->info?ae->info:"", ",\n");
75 +
76 if(unlikely(ae->flags & HEALTH_ENTRY_FLAG_NO_CLEAR_NOTIFICATION)) {
77 buffer_strcat(wb, "\t\t\"no_clear_notification\": true,\n");
78 }