Skip to content

Commit 1d84a25

Browse files
committed
include a trailing \0 in SVs holding trie info
RT Perl#13427 TRIE_STORE_REVCHAR() was creating SvPV()s with no trailing '\0'. This doesn't really matter given the specialised use these are put to, but it upset valgrind et al when perl was run with -Drv which printf("%s")'s the contents of the string.
1 parent 95f2d79 commit 1d84a25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

regcomp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2526,7 +2526,8 @@ is the recommended Unicode-aware way of saying
25262526
if (UTF) { \
25272527
SV *zlopp = newSV(UTF8_MAXBYTES); \
25282528
unsigned char *flrbbbbb = (unsigned char *) SvPVX(zlopp); \
2529-
unsigned const char *const kapow = uvchr_to_utf8(flrbbbbb, val); \
2529+
unsigned char *const kapow = uvchr_to_utf8(flrbbbbb, val); \
2530+
*kapow = '\0'; \
25302531
SvCUR_set(zlopp, kapow - flrbbbbb); \
25312532
SvPOK_on(zlopp); \
25322533
SvUTF8_on(zlopp); \

0 commit comments

Comments
 (0)