diff options
author | Karl Williamson <khw@cpan.org> | 2018-07-30 22:09:12 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-09-10 17:37:31 -0600 |
commit | db54010671d6c27faf667d658073743b14cd9b58 (patch) | |
tree | 20a37e67749cadfb10fc94d29ea06714e7f3f716 /utf8.c | |
parent | 295a484ee22a430520edcf29ce6d2353844fd6c4 (diff) | |
download | perl-db54010671d6c27faf667d658073743b14cd9b58.tar.gz |
utf8.c: Don't assume UTF-8 sequence has enough space.
Instead use the end pointer passed in.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -3950,7 +3950,7 @@ Perl__to_utf8_fold_flags(pTHX_ const U8 *p, /* Special case these two characters, as what normally gets * returned under locale doesn't work */ - if (memEQs((char *) p, UTF8SKIP(p), CAP_SHARP_S)) + if (memBEGINs((char *) p, e - p, CAP_SHARP_S)) { /* diag_listed_as: Can't do %s("%s") on non-UTF-8 locale; resolved to "%s". */ Perl_ck_warner(aTHX_ packWARN(WARN_LOCALE), @@ -3960,7 +3960,7 @@ Perl__to_utf8_fold_flags(pTHX_ const U8 *p, } else #endif - if (memEQs((char *) p, UTF8SKIP(p), LONG_S_T)) + if (memBEGINs((char *) p, e - p, LONG_S_T)) { /* diag_listed_as: Can't do %s("%s") on non-UTF-8 locale; resolved to "%s". */ Perl_ck_warner(aTHX_ packWARN(WARN_LOCALE), @@ -3979,7 +3979,7 @@ Perl__to_utf8_fold_flags(pTHX_ const U8 *p, * 255/256 boundary which is forbidden under /l, and so the code * wouldn't catch that they are equivalent (which they are only in * this release) */ - else if (memEQs((char *) p, UTF8SKIP(p), DOTTED_I)) { + else if (memBEGINs((char *) p, e - p, DOTTED_I)) { /* diag_listed_as: Can't do %s("%s") on non-UTF-8 locale; resolved to "%s". */ Perl_ck_warner(aTHX_ packWARN(WARN_LOCALE), "Can't do fc(\"\\x{0130}\") on non-UTF-8 locale; " |