prevent statsd null pointer dereference introduced by #3342
Costa Tsaousis (ktsaou) committed
Jan 26, 2018 at 19:20 UTC
8c46f67d1544558fe93cbe7fb7ac15344d9b7ea8
1 file changed
+1
-1
src/statsd.c
+1
-1
@@ -435,7 +435,7 @@ static inline void statsd_reset_metric(STATSD_METRIC *m) {
435
}
436
437
static inline int value_is_zinit(const char *value) {
438
- return (*value == 'z' && *++value == 'i' && *++value == 'n' && *++value == 'i' && *++value == 't' && *++value == '\0');
438
+ return (value && *value == 'z' && *++value == 'i' && *++value == 'n' && *++value == 'i' && *++value == 't' && *++value == '\0');
439
}
440
441
static inline void statsd_process_gauge(STATSD_METRIC *m, const char *value, const char *sampling) {