summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-06-14 13:10:08 +0100
committerDavid Mitchell <davem@iabyn.com>2012-06-14 13:10:08 +0100
commitc8d84f8c67ae20ce66d0a8e68579817d47224ab2 (patch)
tree501ff952b3ec9127f54112708e9df7a5cee36e1d /regcomp.c
parenteb58a7e122f6228be1255f72e5f8e9834727ffdf (diff)
downloadperl-c8d84f8c67ae20ce66d0a8e68579817d47224ab2.tar.gz
run-time /(?{})/: fix an buffer overrun
String length calculation didn't allow for trailing nul. (spotted by Nicholas)
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 038a4a6c27..7500e37052 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;