From: Victor Julien Date: Thu, 5 Oct 2023 08:25:16 +0000 (+0200) Subject: detect/pcre: match data is const at match time X-Git-Tag: suricata-8.0.0-beta1~2004 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b69f4cb5cf964114103812fa8370530d2260fbeb;p=thirdparty%2Fsuricata.git detect/pcre: match data is const at match time --- diff --git a/src/detect-pcre.c b/src/detect-pcre.c index 913d782f4a..848f6b9680 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -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;