Skip to content

Commit

Permalink
include a trailing \0 in SVs holding trie info
Browse files Browse the repository at this point in the history
RT #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.
  • Loading branch information
iabyn committed Aug 6, 2019
1 parent 95f2d79 commit 1d84a25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion regcomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,8 @@ is the recommended Unicode-aware way of saying
if (UTF) { \
SV *zlopp = newSV(UTF8_MAXBYTES); \
unsigned char *flrbbbbb = (unsigned char *) SvPVX(zlopp); \
unsigned const char *const kapow = uvchr_to_utf8(flrbbbbb, val); \
unsigned char *const kapow = uvchr_to_utf8(flrbbbbb, val); \
*kapow = '\0'; \
SvCUR_set(zlopp, kapow - flrbbbbb); \
SvPOK_on(zlopp); \
SvUTF8_on(zlopp); \
Expand Down

0 comments on commit 1d84a25

Please sign in to comment.