diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-24 02:55:33 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-24 02:55:33 +0000 |
commit | ba210ebec161cde003bc967e8e460c72f71fb70c (patch) | |
tree | 7eefd78e8e365cbf64ddf49314681d17b83c3025 /perlapi.c | |
parent | 177b92d2814bfc842f28f277e0a2f353c652a5e3 (diff) | |
download | perl-ba210ebec161cde003bc967e8e460c72f71fb70c.tar.gz |
Make the UTF-8 decoding stricter and more verbose when
malformation happens. This involved adding an argument
to utf8_to_uv_chk(), which involved changing its prototype,
and prefer STRLEN over I32 for the UTF-8 length, which as
a domino effect necessitated changing the prototypes of
scan_bin(), scan_oct(), scan_hex(), and reg_uni().
The stricter UTF-8 decoding checking uses Markus Kuhn's
UTF-8 Decode Stress Tester from
http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
p4raw-id: //depot/perl@7416
Diffstat (limited to 'perlapi.c')
-rw-r--r-- | perlapi.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -2638,14 +2638,14 @@ Perl_save_threadsv(pTHXo_ PADOFFSET i) #undef Perl_scan_bin NV -Perl_scan_bin(pTHXo_ char* start, I32 len, I32* retlen) +Perl_scan_bin(pTHXo_ char* start, STRLEN len, STRLEN* retlen) { return ((CPerlObj*)pPerl)->Perl_scan_bin(start, len, retlen); } #undef Perl_scan_hex NV -Perl_scan_hex(pTHXo_ char* start, I32 len, I32* retlen) +Perl_scan_hex(pTHXo_ char* start, STRLEN len, STRLEN* retlen) { return ((CPerlObj*)pPerl)->Perl_scan_hex(start, len, retlen); } @@ -2659,7 +2659,7 @@ Perl_scan_num(pTHXo_ char* s, YYSTYPE *lvalp) #undef Perl_scan_oct NV -Perl_scan_oct(pTHXo_ char* start, I32 len, I32* retlen) +Perl_scan_oct(pTHXo_ char* start, STRLEN len, STRLEN* retlen) { return ((CPerlObj*)pPerl)->Perl_scan_oct(start, len, retlen); } @@ -3380,16 +3380,16 @@ Perl_bytes_to_utf8(pTHXo_ U8 *s, STRLEN *len) #undef Perl_utf8_to_uv UV -Perl_utf8_to_uv(pTHXo_ U8 *s, I32* retlen) +Perl_utf8_to_uv(pTHXo_ U8 *s, STRLEN* retlen) { return ((CPerlObj*)pPerl)->Perl_utf8_to_uv(s, retlen); } #undef Perl_utf8_to_uv_chk UV -Perl_utf8_to_uv_chk(pTHXo_ U8 *s, I32* retlen, bool checking) +Perl_utf8_to_uv_chk(pTHXo_ U8 *s, STRLEN curlen, STRLEN* retlen, bool checking) { - return ((CPerlObj*)pPerl)->Perl_utf8_to_uv_chk(s, retlen, checking); + return ((CPerlObj*)pPerl)->Perl_utf8_to_uv_chk(s, curlen, retlen, checking); } #undef Perl_uv_to_utf8 |