New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perl crashes when utf8::upgrade($offsetOK_scalar) #7189
Comments
From BQW10602@nifty.comCreated by bqw10602@nifty.comPerl crashes at utf8::upgrade($a) when $a is OOK. $a = "123456\xFF"; Regards, Perl Info
|
From BQW10602@nifty.comOn 20 Mar 2004 16:52:22 -0000
Here is a patch. Inline Patchdiff -urN perl~/lib/utf8.t perl/lib/utf8.t
--- perl~/lib/utf8.t Mon Mar 08 06:56:46 2004
+++ perl/lib/utf8.t Sun Mar 21 13:48:40 2004
@@ -37,7 +37,7 @@
#
#
-plan tests => 144;
+plan tests => 145;
{
# bug id 20001009.001
@@ -414,4 +414,14 @@
eval {utf8::encode("£")};
like($@, qr/^Modification of a read-only value attempted/,
"utf8::encode should refuse to touch read-only values");
+}
+
+{
+ my $a = "456\xb6";
+ utf8::upgrade($a);
+
+ my $b = "123456\xb6";
+ $b =~ s/^...//;
+ utf8::upgrade($b);
+ is($b, $a, "utf8::upgrade OffsetOK");
}
diff -urN perl~/sv.c perl/sv.c
--- perl~/sv.c Wed Mar 17 03:42:24 2004
+++ perl/sv.c Sun Mar 21 13:34:42 2004
@@ -3494,7 +3494,8 @@
}
if (hibit) {
STRLEN len;
-
+ SvOOK_off(sv);
+ s = (U8 *) SvPVX(sv);
len = SvCUR(sv) + 1; /* Plus the \0 */
SvPVX(sv) = (char*)bytes_to_utf8((U8*)s, &len);
SvCUR(sv) = len - 1;
regards, |
From @rgsSADAHIRO Tomoyuki wrote:
Thanks, applied to bleadperl as #22545. |
The RT System itself - Status changed from 'new' to 'open' |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#27803 (status was 'resolved')
Searchable as RT27803$
The text was updated successfully, but these errors were encountered: