]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
email-json: delete white space from "from"
authorEric Leblond <eric@regit.org>
Mon, 4 May 2015 16:14:03 +0000 (18:14 +0200)
committerEric Leblond <eric@regit.org>
Tue, 6 Oct 2015 21:30:45 +0000 (23:30 +0200)
The From field is handled separatly and it could also starts by
white spaces.

src/output-json-email-common.c

index 533ce17ade4ca828d585a19da841cf33991816ed..ecbd273a2f8e90c1654d4e8c30ce6c8c27c7045e 100644 (file)
@@ -240,7 +240,8 @@ json_t *JsonEmailLogJsonData(const Flow *f, void *state, void *vtx, uint64_t tx_
                                         (size_t)field->value_len);
                 if (likely(s != NULL)) {
                     //printf("From: \"%s\"\n", s);
-                    json_object_set_new(sjs, "from", json_string(s));
+                    char * sp = SkipWhiteSpaceTill(s, s + strlen(s));
+                    json_object_set_new(sjs, "from", json_string(sp));
                     SCFree(s);
                 }
             }