tags 365125 + patch pending
thanks
On Tue, May 09, 2006 at 06:50:01PM -0400, [EMAIL PROTECTED] wrote:
>I would like to add some more info on this bug to help others such as me
>that have been bitten by this. I use a program VOCP to do voice message
>processing among other things and it uses perl-tk 804.027 for its
>graphical elements. These elements ceased to function upon upgrading to
>perl_5.8.4-8sarge4.
>
>I've discovered that you can downgrade the single package perl-base to
>perl-base_5.8.4-8sarge3 available at snapshot.debian.net to restore
>perl-tk functionallity.
OK. It would seem that the utf8 change introduced in sarge4 does indeed
not play nicely with the newer version of Tk.
I've prepared a new version of debian/patches/23_fix_utf8_taint which
incorporates upstream changes #23084 and #23085 from Nick Ing-Simmonds
for Tk.
This seems to work for the original testcase for utf8/taint, and the
widget demo from perl-tk 804.027-4 works for me.
Please test:
$ apt-get source perl
$ cd perl-5.8.4
$ debian/rules unpatch
[replace debian/patches/23_fix_utf8_taint attached]
$ debian/rules patch
$ dch -n Test Tk fix
$ dpkg-buildpackage -rfakeroot -us -uc
--bod
Fix problem with utf8/taint interaction (upstream changes #22842,
#22843 and #22902).
Thanks to Steinar Gunderson for analysis/patch.
Additionally apply upstream changes #23084 and #23085 to correct problems
with Tk 804.27 .
diff -Naur --exclude=debian perl-5.8.4.orig/ext/Encode/lib/Encode/CN/HZ.pm
perl-5.8.4/ext/Encode/lib/Encode/CN/HZ.pm
--- perl-5.8.4.orig/ext/Encode/lib/Encode/CN/HZ.pm 2004-02-23
19:29:12.000000000 +0000
+++ perl-5.8.4/ext/Encode/lib/Encode/CN/HZ.pm 2006-05-10 03:08:42.303791195
+0000
@@ -152,7 +152,8 @@
$ret .= pack 'a*', $tmp; # remove UTF8 flag.
}
elsif ($str =~ s/(.)//) {
- my $tmp = $GB->encode($1, $chk);
+ my $s = $1;
+ my $tmp = $GB->encode($s, $chk);
last if !defined $tmp;
if (length $tmp == 2) { # maybe a valid GB char (XXX)
if ($in_ascii) {
diff -Naur --exclude=debian
perl-5.8.4.orig/ext/Encode/lib/Encode/Unicode/UTF7.pm
perl-5.8.4/ext/Encode/lib/Encode/Unicode/UTF7.pm
--- perl-5.8.4.orig/ext/Encode/lib/Encode/Unicode/UTF7.pm 2003-05-21
14:15:16.000000000 +0000
+++ perl-5.8.4/ext/Encode/lib/Encode/Unicode/UTF7.pm 2006-05-10
03:08:42.313791120 +0000
@@ -6,7 +6,7 @@
no warnings 'redefine';
use base qw(Encode::Encoding);
__PACKAGE__->Define('UTF-7');
-our $VERSION = do { my @r = (q$Revision: 0.2 $ =~ /\d+/g); sprintf
"%d."."%02d" x $#r, @r };
+our $VERSION = '2.00_01';
use MIME::Base64;
use Encode;
@@ -38,7 +38,8 @@
if ($1 eq "+"){
$bytes .= "+-";
}else{
- my $base64 = encode_base64($e_utf16->encode($1), '');
+ my $s = $1;
+ my $base64 = encode_base64($e_utf16->encode($s), '');
$base64 =~ s/=+$//;
$bytes .= "+$base64-";
}
diff -Naur --exclude=debian perl-5.8.4.orig/sv.c perl-5.8.4/sv.c
--- perl-5.8.4.orig/sv.c 2004-03-31 15:03:57.000000000 +0000
+++ perl-5.8.4/sv.c 2006-05-10 03:11:23.912581291 +0000
@@ -3438,18 +3438,20 @@
U8 *s, *t, *e;
int hibit = 0;
- if (!sv)
- return 0;
-
if (!SvPOK(sv)) {
STRLEN len = 0;
- (void) sv_2pv_flags(sv,&len, flags);
- if (!SvPOK(sv))
- return len;
+ if (SvREADONLY(sv) && (SvPOKp(sv) || SvIOKp(sv) || SvNOKp(sv))) {
+ (void) sv_2pv_flags(sv,&len, flags);
+ if (SvUTF8(sv))
+ return len;
+ } else {
+ (void) SvPV_force(sv,len);
+ }
}
- if (SvUTF8(sv))
+ if (SvUTF8(sv)) {
return SvCUR(sv);
+ }
if (SvREADONLY(sv) && SvFAKE(sv)) {
sv_force_normal(sv);
@@ -3504,7 +3506,7 @@
bool
Perl_sv_utf8_downgrade(pTHX_ register SV* sv, bool fail_ok)
{
- if (SvPOK(sv) && SvUTF8(sv)) {
+ if (SvPOKp(sv) && SvUTF8(sv)) {
if (SvCUR(sv)) {
U8 *s;
STRLEN len;
@@ -3566,7 +3568,7 @@
bool
Perl_sv_utf8_decode(pTHX_ register SV *sv)
{
- if (SvPOK(sv)) {
+ if (SvPOKp(sv)) {
U8 *c;
U8 *e;