]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/pcre: match data is const at match time
authorVictor Julien <vjulien@oisf.net>
Thu, 5 Oct 2023 08:25:16 +0000 (10:25 +0200)
committerVictor Julien <victor@inliniac.net>
Fri, 1 Dec 2023 13:55:42 +0000 (14:55 +0100)
src/detect-pcre.c

index 913d782f4afee237ec477cc57af4d48126f0ef3d..848f6b9680fed512001c24d981b8925cf98d1369 100644 (file)
@@ -79,7 +79,7 @@ static int pcre2_use_jit = 1;
 
 /* \brief Helper function for using pcre2_match with/without JIT
  */
-static inline int DetectPcreExec(DetectEngineThreadCtx *det_ctx, DetectPcreData *pd,
+static inline int DetectPcreExec(DetectEngineThreadCtx *det_ctx, const DetectPcreData *pd,
         const char *str, const size_t strlen, int start_offset, int options,
         pcre2_match_data *match)
 {
@@ -182,7 +182,7 @@ int DetectPcrePayloadMatch(DetectEngineThreadCtx *det_ctx, const Signature *s,
     uint32_t len = 0;
     PCRE2_SIZE capture_len = 0;
 
-    DetectPcreData *pe = (DetectPcreData *)smd->ctx;
+    const DetectPcreData *pe = (const DetectPcreData *)smd->ctx;
 
     if (pe->flags & DETECT_PCRE_RELATIVE) {
         ptr = payload + det_ctx->buffer_offset;