]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
jsonbuilder: fix build error 5021/head
authorGiuseppe Longo <giuseppe@glongo.it>
Thu, 4 Jun 2020 19:20:23 +0000 (21:20 +0200)
committerGiuseppe Longo <giuseppe@glongo.it>
Thu, 4 Jun 2020 19:20:23 +0000 (21:20 +0200)
Clang's build in travis-ci is actually failing because of this error:

output-json-alert.c:476:40: error: missing field 'state_index' initializer

      [-Werror,-Wmissing-field-initializers]

            JsonBuilderMark mark = { 0 };

src/output-json-alert.c
src/output-json-email-common.c
src/output-json-file.c

index d27804e4890aadd93edf3a9d6929ea094d5226f8..ff921bbfc53a2a39151ae2fef8f810652107780e 100644 (file)
@@ -473,7 +473,7 @@ static int AlertJson(ThreadVars *tv, JsonAlertLogThread *aft, const Packet *p)
 
         if (json_output_ctx->flags & LOG_JSON_APP_LAYER && p->flow != NULL) {
             const AppProto proto = FlowGetAppProtocol(p->flow);
-            JsonBuilderMark mark = { 0 };
+            JsonBuilderMark mark = { 0, 0, 0 };
             switch (proto) {
                 case ALPROTO_HTTP:
                     // TODO: Could result in an empty http object being logged.
index c0f110273615ed6a62cb56e176c0e63f906e72f3..5bdb495e3fafe47e3c00f7d98d5eb857bc3fe934 100644 (file)
@@ -179,7 +179,7 @@ static int JsonEmailAddToJsonArray(const uint8_t *val, size_t len, void *data)
 static void EveEmailLogJSONCustom(OutputJsonEmailCtx *email_ctx, JsonBuilder *js, SMTPTransaction *tx)
 {
     int f = 0;
-    JsonBuilderMark mark = { 0 };
+    JsonBuilderMark mark = { 0, 0, 0 };
     MimeDecField *field;
     MimeDecEntity *entity = tx->msg_tail;
     if (entity == NULL) {
@@ -234,7 +234,7 @@ static bool EveEmailLogJsonData(const Flow *f, void *state, void *vtx, uint64_t
     SMTPState *smtp_state;
     MimeDecParseState *mime_state;
     MimeDecEntity *entity;
-    JsonBuilderMark mark = { 0 };
+    JsonBuilderMark mark = { 0, 0, 0 };
 
     /* check if we have SMTP state or not */
     AppProto proto = FlowGetAppProtocol(f);
@@ -365,7 +365,7 @@ TmEcode EveEmailLogJson(JsonEmailLogThread *aft, JsonBuilder *js, const Packet *
 {
     OutputJsonEmailCtx *email_ctx = aft->emaillog_ctx;
     SMTPTransaction *tx = (SMTPTransaction *) vtx;
-    JsonBuilderMark mark = { 0 };
+    JsonBuilderMark mark = { 0, 0, 0 };
 
     jb_get_mark(js, &mark);
     jb_open_object(js, "email");
index 32145300ce6141c99f006859078cce51a7eaefb6..6abc1667e4dddf85aa4c168b8245aafa2f0f7817 100644 (file)
@@ -122,7 +122,7 @@ JsonBuilder *JsonBuildFileInfoRecord(const Packet *p, const File *ff,
     if (unlikely(js == NULL))
         return NULL;
 
-    JsonBuilderMark mark = { 0 };
+    JsonBuilderMark mark = { 0, 0, 0 };
     switch (p->flow->alproto) {
         case ALPROTO_HTTP:
             jb_open_object(js, "http");