]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: GetTxData callback is mandatory
authorVictor Julien <victor@inliniac.net>
Sun, 7 Jun 2020 19:13:32 +0000 (21:13 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 11 Jul 2020 06:37:40 +0000 (08:37 +0200)
src/app-layer-parser.c

index bb3c3872fd913322f65efdc05d721631f358e059..6de88860f584b210f5f46bc00fd6e02086171b4c 100644 (file)
@@ -1460,6 +1460,7 @@ static void ValidateParserProtoDump(AppProto alproto, uint8_t ipproto)
     printf("- StateAlloc %p StateFree %p\n", ctx->StateAlloc, ctx->StateFree);
     printf("- StateGetTx %p StateGetTxCnt %p StateTransactionFree %p\n",
             ctx->StateGetTx, ctx->StateGetTxCnt, ctx->StateTransactionFree);
+    printf("- GetTxData %p\n", ctx->GetTxData);
     printf("- StateGetProgress %p StateGetProgressCompletionStatus %p\n", ctx->StateGetProgress, ctx_def->StateGetProgressCompletionStatus);
     printf("- GetTxDetectState %p SetTxDetectState %p\n", ctx->GetTxDetectState, ctx->SetTxDetectState);
     printf("Optional:\n");
@@ -1505,7 +1506,9 @@ static void ValidateParserProto(AppProto alproto, uint8_t ipproto)
     if (!(BOTH_SET_OR_BOTH_UNSET(ctx->GetTxDetectState, ctx->SetTxDetectState))) {
         goto bad;
     }
-
+    if (ctx->GetTxData == NULL) {
+        goto bad;
+    }
     return;
 bad:
     ValidateParserProtoDump(alproto, ipproto);