>From fc459a80d20d437ce244753434371d02cf016a62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Mon, 15 Nov 2021 12:36:17 -0800 Subject: [PATCH] pcre: avoid using SIZE_MAX MIME-Version: 1.0 Content-Type: text/x-patch; charset=UTF-8 Content-Transfer-Encoding: 8bit Not a problem in practice, as all versions of PCRE2 that define PCRE2_SIZE_MAX do it as SIZE_MAX, but lets avoid any surprises by using the same value we are using everywhere else in case it ever changes. Signed-off-by: Carlo Marcelo Arenas Belón --- src/pcresearch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pcresearch.c b/src/pcresearch.c index c12c674..dcf146a 100644 --- a/src/pcresearch.c +++ b/src/pcresearch.c @@ -82,7 +82,8 @@ jit_exec (struct pcre_comp *pc, char const *subject, idx_t search_bytes, Going over the jitstack_max limit could trigger an int overflow bug. */ int STACK_GROWTH_RATE = 8192; - idx_t jitstack_max = MIN (IDX_MAX, SIZE_MAX - (STACK_GROWTH_RATE - 1)); + idx_t jitstack_max = MIN (IDX_MAX, + PCRE2_SIZE_MAX - (STACK_GROWTH_RATE - 1)); int e = pcre2_match (pc->cre, (PCRE2_SPTR) subject, search_bytes, search_offset, options, pc->data, pc->mcontext); -- 2.34.0.352.g07dee3c5e1