From 4b88fb76efce8c436e63b907c9842345d4fa77c7 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 19 Mar 2012 15:38:06 -0600 Subject: Use the new utf8 to code point functions These functions should be used in preference to the old ones which can read beyond the end of the input string. --- pp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'pp.c') diff --git a/pp.c b/pp.c index f3c4ebb5a4..ba3ac1f0bf 100644 --- a/pp.c +++ b/pp.c @@ -3383,7 +3383,7 @@ PP(pp_chr) sv_recode_to_utf8(TARG, PL_encoding); tmps = SvPVX(TARG); if (SvCUR(TARG) == 0 || !is_utf8_string((U8*)tmps, SvCUR(TARG)) || - UNICODE_IS_REPLACEMENT(utf8_to_uvchr((U8*)tmps, NULL))) { + UNICODE_IS_REPLACEMENT(utf8_to_uvchr_buf((U8*)tmps, (U8*) tmps + SvCUR(TARG), NULL))) { SvGROW(TARG, 2); tmps = SvPVX(TARG); SvCUR_set(TARG, 1); @@ -3795,7 +3795,7 @@ PP(pp_uc) uv = _to_utf8_upper_flags(s, tmpbuf, &ulen, cBOOL(IN_LOCALE_RUNTIME), &tainted); if (uv == GREEK_CAPITAL_LETTER_IOTA - && utf8_to_uvchr(s, 0) == COMBINING_GREEK_YPOGEGRAMMENI) + && utf8_to_uvchr_buf(s, send, 0) == COMBINING_GREEK_YPOGEGRAMMENI) { in_iota_subscript = TRUE; } @@ -5344,7 +5344,7 @@ PP(pp_reverse) continue; } else { - if (!utf8_to_uvchr(s, 0)) + if (!utf8_to_uvchr_buf(s, send, 0)) break; up = (char*)s; s += UTF8SKIP(s); -- cgit v1.2.1