From 6cf267e4fc56547a4b8554ab3add75c9b470a4d1 Mon Sep 17 00:00:00 2001 From: TheEragon Date: Thu, 8 Feb 2024 08:34:26 +0100 Subject: [PATCH] Mark pso_list const List isn't modified in the code and belongs to read only section and not read write as it was. --- src/pcre2_compile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c index 69f4fab2c..8b364977c 100644 --- a/src/pcre2_compile.c +++ b/src/pcre2_compile.c @@ -833,7 +833,7 @@ typedef struct pso { /* NB: STRING_UTFn_RIGHTPAR contains the length as well */ -static pso pso_list[] = { +static const pso pso_list[] = { { (uint8_t *)STRING_UTFn_RIGHTPAR, PSO_OPT, PCRE2_UTF }, { (uint8_t *)STRING_UTF_RIGHTPAR, 4, PSO_OPT, PCRE2_UTF }, { (uint8_t *)STRING_UCP_RIGHTPAR, 4, PSO_OPT, PCRE2_UCP }, @@ -10312,7 +10312,7 @@ if ((options & PCRE2_LITERAL) == 0) for (i = 0; i < sizeof(pso_list)/sizeof(pso); i++) { uint32_t c, pp; - pso *p = pso_list + i; + const pso *p = pso_list + i; if (patlen - skipatstart - 2 >= p->length && PRIV(strncmp_c8)(ptr + skipatstart + 2, (char *)(p->name),