]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Fix two more potential issues like bug 1550
authorVictor Julien <victor@inliniac.net>
Tue, 22 Sep 2015 13:20:25 +0000 (15:20 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 8 Feb 2016 08:20:08 +0000 (09:20 +0100)
src/detect-engine-content-inspection.c

index ae86a3574e1e6425abda7373ce7b307dffa06c10..be6d09f6cd7a1ba2e87486ae5357900e914c6e97 100644 (file)
@@ -433,7 +433,7 @@ int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx
 
         /* if we have dce enabled we will have to use the endianness
          * specified by the dce header */
-        if (data && flags & DETECT_BYTETEST_DCE) {
+        if (flags & DETECT_BYTETEST_DCE && data != NULL) {
             DCERPCState *dcerpc_state = (DCERPCState *)data;
             /* enable the endianness flag temporarily.  once we are done
              * processing we reset the flags to the original value*/
@@ -459,7 +459,7 @@ int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx
 
         /* if we have dce enabled we will have to use the endianness
          * specified by the dce header */
-        if (flags & DETECT_BYTEJUMP_DCE) {
+        if (flags & DETECT_BYTEJUMP_DCE && data != NULL) {
             DCERPCState *dcerpc_state = (DCERPCState *)data;
             /* enable the endianness flag temporarily.  once we are done
              * processing we reset the flags to the original value*/
@@ -482,7 +482,7 @@ int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx
         /* if we have dce enabled we will have to use the endianness
          * specified by the dce header */
         if ((bed->flags & DETECT_BYTE_EXTRACT_FLAG_ENDIAN) &&
-            endian == DETECT_BYTE_EXTRACT_ENDIAN_DCE) {
+            endian == DETECT_BYTE_EXTRACT_ENDIAN_DCE && data != NULL) {
 
             DCERPCState *dcerpc_state = (DCERPCState *)data;
             /* enable the endianness flag temporarily.  once we are done