Skip to content

Commit 1cba2d4

Browse files
committed
PCRE2 fix: correct length arg in calls to match functions
1 parent 9d4b426 commit 1cba2d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apache2/msc_pcre.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,15 +251,15 @@ int msc_regexec_ex(msc_regex_t *regex, const char *s, unsigned int slen,
251251

252252
#ifdef WITH_PCRE_JIT
253253
if (regex->jit_compile_rc == 0) {
254-
pcre2_ret = pcre2_jit_match(regex->re, pcre2_s, (PCRE2_SIZE)strlen(s),
254+
pcre2_ret = pcre2_jit_match(regex->re, pcre2_s, slen,
255255
(PCRE2_SIZE)(startoffset), (uint32_t)options, match_data, regex->match_context);
256256
}
257257
if (regex->jit_compile_rc != 0 || pcre2_ret == PCRE2_ERROR_JIT_STACKLIMIT) {
258-
pcre2_ret = pcre2_match(regex->re, pcre2_s, (PCRE2_SIZE)strlen(s),
258+
pcre2_ret = pcre2_match(regex->re, pcre2_s, slen,
259259
(PCRE2_SIZE)(startoffset), (PCRE2_NO_JIT | (uint32_t)options), match_data, regex->match_context);
260260
}
261261
#else
262-
pcre2_ret = pcre2_match(regex->re, pcre2_s, (PCRE2_SIZE)strlen(s),
262+
pcre2_ret = pcre2_match(regex->re, pcre2_s, slen,
263263
(PCRE2_SIZE)(startoffset), (uint32_t)options, match_data, regex->match_context);
264264
#endif
265265
if (match_data != NULL) {

0 commit comments

Comments
 (0)