Fix an infinite loop in the statsd plugin (#10180)
Vladimir Kobal committed
Nov 3, 2020 at 11:19 UTC
962abc2a99e8060a04243c06a1527b892fb0cd7a
1 file changed
+4
-1
collectors/statsd.plugin/statsd.c
+4
-1
@@ -698,7 +698,10 @@ static inline size_t statsd_process(char *buffer, size_t size, int require_newli
698
699
s = name_end = (char *)statsd_parse_skip_up_to(name = s, ':', '|');
700
if(name == name_end) {
701
- s = statsd_parse_skip_spaces(s);
701
+ if (*s) {
702
+ s++;
703
+ s = statsd_parse_skip_spaces(s);
704
+ }
705
continue;
706
}
707