summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/utf8.c b/utf8.c
index dfebf7228b..29b30cf927 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2707,6 +2707,8 @@ Perl__to_utf8_fold_flags(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp, U8 flags, b
PERL_ARGS_ASSERT__TO_UTF8_FOLD_FLAGS;
+ assert(p != ustrp); /* Otherwise overwrites */
+
if (UTF8_IS_INVARIANT(*p)) {
if (flags & FOLD_FLAGS_LOCALE) {
result = toLOWER_LC(*p);