From: Sascha Steinbiss Date: Fri, 1 Sep 2017 14:24:56 +0000 (+0200) Subject: json: skip over double dots in output tokenizing X-Git-Tag: suricata-4.0.1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d25593b4aa129be9194dfbc73165cd6da186902;p=thirdparty%2Fsuricata.git json: skip over double dots in output tokenizing Interface name shortening introduces double periods ('..') as spacers, which cause issues during JSON stats serialization as there '.' characters are also used as separators to define nesting of the JSON output. This commit makes sure that '..' are skipped during tokenizing. Fixes Redmine bug #2208. --- diff --git a/src/output-json-stats.c b/src/output-json-stats.c index 436d621ac4..0b99948b36 100644 --- a/src/output-json-stats.c +++ b/src/output-json-stats.c @@ -68,6 +68,8 @@ static json_t *OutputStats2Json(json_t *js, const char *key) const char *dot = index(key, '.'); if (dot == NULL) return NULL; + if (*(dot + 1) == '.' && *(dot + 2) != '\0') + dot = index(dot + 2, '.'); size_t predot_len = (dot - key) + 1; char s[predot_len];