From c8d84f8c67ae20ce66d0a8e68579817d47224ab2 Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Thu, 14 Jun 2012 13:10:08 +0100 Subject: [PATCH] run-time /(?{})/: fix an buffer overrun String length calculation didn't allow for trailing nul. (spotted by Nicholas) --- regcomp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regcomp.c b/regcomp.c index 038a4a6..7500e37 100644 --- a/regcomp.c +++ b/regcomp.c @@ -5041,7 +5041,7 @@ S_compile_runtime_code(pTHX_ RExC_state_t * const pRExC_state, int n = 0; STRLEN s; char *p, *newpat; - int newlen = plen + 5; /* allow for "qr''x" extra chars */ + int newlen = plen + 6; /* allow for "qr''x\0" extra chars */ SV *sv, *qr_ref; dSP; -- 1.8.3.1