From c865a5a7e58d3860a6d99b268fd48e7d2b5f3f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Fri, 25 Aug 2023 03:05:49 +0200 Subject: [PATCH] Fix the crash of Regexp.Replace() when pcre2 library is used. [GB.PCRE] * BUG: Fix the crash of Regexp.Replace() when pcre2 library is used. --- gb.pcre/src/regexp_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gb.pcre/src/regexp_common.h b/gb.pcre/src/regexp_common.h index 06d433bd0..36af51a7a 100644 --- a/gb.pcre/src/regexp_common.h +++ b/gb.pcre/src/regexp_common.h @@ -93,7 +93,7 @@ BEGIN_METHOD(RegExp_Replace, GB_STRING subject; GB_STRING pattern; GB_STRING rep #endif exec(&r, GB.StringLength(subject) - offset); - if (r.ovector[0] < 0) + if (!r.ovector || r.ovector[0] < 0) break; _subst_regexp = &r;