Skip to content
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

utf-7 codec in Encode uses m/\G/g without resetting pos() #9392

Closed
p5pRT opened this issue Jun 25, 2008 · 5 comments
Closed

utf-7 codec in Encode uses m/\G/g without resetting pos() #9392

p5pRT opened this issue Jun 25, 2008 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 25, 2008

Migrated from rt.perl.org#56342 (status was 'rejected')

Searchable as RT56342$

@p5pRT
Copy link
Author

p5pRT commented Jun 25, 2008

From alex@kapranoff.ru

Created by alex@kapranoff.ru

This is a bug report for perl from alex@​kapranoff.ru,
generated with the help of perlbug 1.36 running under perl 5.10.0.

-----------------------------------------------------------------

Trivial patch​:

Inline Patch
--- lib/Encode/Unicode/UTF7.pm.orig	Thu Sep  2 19:53:51 2004
+++ lib/Encode/Unicode/UTF7.pm	Thu Feb 28 17:03:56 2008
@@ -51,10 +51,11 @@
      return $bytes;
  }
  	
-sub decode{
+sub decode($$;$){
      my ($obj, $bytes, $chk) = @_;
      my $len = length($bytes);
      my $str = "";
+    pos($bytes) = 0;
      while (pos($bytes) < $len) {
  	if    ($bytes =~ /\G([^+]+)/ogc) {
  	    $str .= $1;
Perl Info

Flags:
     category=core
     severity=low

Site configuration information for perl 5.10.0:

Configured by kappa at Tue Dec 18 22:42:37 MSK 2007.

Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
   Platform:
     osname=linux, osvers=2.6.22-14-generic, 
archname=i686-linux-thread-multi-64int-ld
     uname='linux aukland 2.6.22-14-generic #1 smp sun oct 14 23:05:12 
gmt 2007 i686 gnulinux '
     config_args=''
     hint=recommended, useposix=true, d_sigaction=define
     useithreads=define, usemultiplicity=define
     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
     use64bitint=define, use64bitall=undef, uselongdouble=define
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing 
-pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-O2',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe 
-I/usr/local/include'
     ccversion='', gccversion='4.1.3 20070929 (prerelease) (Ubuntu 
4.1.2-16ubuntu2)', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long long', ivsize=8, nvtype='long double', nvsize=12, 
Off_t='off_t', lseeksize=8
     alignbytes=4, prototype=define
   Linker and Libraries:
     ld='cc', ldflags =' -L/usr/local/lib'
     libpth=/usr/local/lib /lib /usr/lib /usr/lib64
     libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc
     perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
     libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a
     gnulibc_version='2.6.1'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
     cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib'

Locally applied patches:



@INC for perl 5.10.0:
     /site/lib
     /usr/local/lib/perl5/5.10.0/i686-linux-thread-multi-64int-ld
     /usr/local/lib/perl5/5.10.0
     /usr/local/lib/perl5/site_perl/5.10.0/i686-linux-thread-multi-64int-ld
     /usr/local/lib/perl5/site_perl/5.10.0
     .


Environment for perl 5.10.0:
     HOME=/home/kappa
     LANG=ru_RU.UTF-8
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
 
PATH=/home/kappa/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
     PERLLIB=/site/lib
     PERL_BADLANG (unset)
     SHELL=/usr/bin/zsh

@p5pRT
Copy link
Author

p5pRT commented Apr 20, 2012

From @cpansprout

Forwarding to the CPAN queue....

On Wed Jun 25 06​:14​:05 2008, kappa wrote​:

This is a bug report for perl from alex@​kapranoff.ru,
generated with the help of perlbug 1.36 running under perl 5.10.0.

-----------------------------------------------------------------

Trivial patch​:

--- lib/Encode/Unicode/UTF7.pm.orig Thu Sep 2 19​:53​:51 2004
+++ lib/Encode/Unicode/UTF7.pm Thu Feb 28 17​:03​:56 2008
@​@​ -51,10 +51,11 @​@​
return $bytes;
}

-sub decode{
+sub decode($$;$){
my ($obj, $bytes, $chk) = @​_;
my $len = length($bytes);
my $str = "";
+ pos($bytes) = 0;
while (pos($bytes) < $len) {
if ($bytes =~ /\G([^+]+)/ogc) {
$str .= $1;

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=core
severity=low
---
Site configuration information for perl 5.10.0​:

Configured by kappa at Tue Dec 18 22​:42​:37 MSK 2007.

Summary of my perl5 (revision 5 version 10 subversion 0)
configuration​:
Platform​:
osname=linux, osvers=2.6.22-14-generic,
archname=i686-linux-thread-multi-64int-ld
uname='linux aukland 2.6.22-14-generic #1 smp sun oct 14 23​:05​:12
gmt 2007 i686 gnulinux '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define,
usesocks=undef
use64bitint=define, use64bitall=undef, uselongdouble=define
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE
-fno-strict-aliasing
-pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-I/usr/local/include'
ccversion='', gccversion='4.1.3 20070929 (prerelease) (Ubuntu
4.1.2-16ubuntu2)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8,
byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
ivtype='long long', ivsize=8, nvtype='long double', nvsize=12,
Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries​:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/lib64
libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.6.1.so, so=so, useshrplib=false,
libperl=libperl.a
gnulibc_version='2.6.1'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib'

Locally applied patches​:

---
@​INC for perl 5.10.0​:
/site/lib
/usr/local/lib/perl5/5.10.0/i686-linux-thread-multi-64int-ld
/usr/local/lib/perl5/5.10.0
/usr/local/lib/perl5/site_perl/5.10.0/i686-linux-thread-multi-
64int-ld
/usr/local/lib/perl5/site_perl/5.10.0
.

---
Environment for perl 5.10.0​:
HOME=/home/kappa
LANG=ru_RU.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)

PATH=/home/kappa/bin​:/usr/local/sbin​:/usr/local/bin​:/usr/sbin​:/usr/bin​:/sbin​:/bin​:/usr/games

 PERLLIB=/site/lib
 PERL\_BADLANG \(unset\)
 SHELL=/usr/bin/zsh

--

Father Chrysostomos

@p5pRT
Copy link
Author

p5pRT commented Apr 20, 2012

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Apr 20, 2012

@cpansprout - Status changed from 'open' to 'rejected'

@p5pRT p5pRT closed this as completed Apr 20, 2012
@p5pRT
Copy link
Author

p5pRT commented Aug 5, 2012

From bug-Encode@rt.cpan.org

<URL​: https://rt.cpan.org/Ticket/Display.html?id=76711 >

Thank you. applied in my repo. WIll be in 2.45.

Dan the Encode Maintainer

On Thu Apr 19 20​:07​:48 2012, perlbug-followup@​perl.org wrote​:

Forwarding to the CPAN queue....

On Wed Jun 25 06​:14​:05 2008, kappa wrote​:

This is a bug report for perl from alex@​kapranoff.ru,
generated with the help of perlbug 1.36 running under perl 5.10.0.

-----------------------------------------------------------------

Trivial patch​:

--- lib/Encode/Unicode/UTF7.pm.orig Thu Sep 2 19​:53​:51 2004
+++ lib/Encode/Unicode/UTF7.pm Thu Feb 28 17​:03​:56 2008
@​@​ -51,10 +51,11 @​@​
return $bytes;
}

-sub decode{
+sub decode($$;$){
my ($obj, $bytes, $chk) = @​_;
my $len = length($bytes);
my $str = "";
+ pos($bytes) = 0;
while (pos($bytes) < $len) {
if ($bytes =~ /\G([^+]+)/ogc) {
$str .= $1;

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags​:
category=core
severity=low
---
Site configuration information for perl 5.10.0​:

Configured by kappa at Tue Dec 18 22​:42​:37 MSK 2007.

Summary of my perl5 (revision 5 version 10 subversion 0)
configuration​:
Platform​:
osname=linux, osvers=2.6.22-14-generic,
archname=i686-linux-thread-multi-64int-ld
uname='linux aukland 2.6.22-14-generic #1 smp sun oct 14
23​:05​:12
gmt 2007 i686 gnulinux '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
useithreads=define, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define,
usesocks=undef
use64bitint=define, use64bitall=undef, uselongdouble=define
usemymalloc=n, bincompat5005=undef
Compiler​:
cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE
-fno-strict-aliasing
-pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O2',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe
-I/usr/local/include'
ccversion='', gccversion='4.1.3 20070929 (prerelease) (Ubuntu
4.1.2-16ubuntu2)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8,
byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=12
ivtype='long long', ivsize=8, nvtype='long double', nvsize=12,
Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries​:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /usr/lib64
libs=-lnsl -lgdbm -ldl -lm -lcrypt -lutil -lpthread -lc
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
libc=/lib/libc-2.6.1.so, so=so, useshrplib=false,
libperl=libperl.a
gnulibc_version='2.6.1'
Dynamic Linking​:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-
E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib'

Locally applied patches​:

---
@​INC for perl 5.10.0​:
/site/lib
/usr/local/lib/perl5/5.10.0/i686-linux-thread-multi-64int-ld
/usr/local/lib/perl5/5.10.0
/usr/local/lib/perl5/site_perl/5.10.0/i686-linux-thread-multi-
64int-ld
/usr/local/lib/perl5/site_perl/5.10.0
.

---
Environment for perl 5.10.0​:
HOME=/home/kappa
LANG=ru_RU.UTF-8
LANGUAGE (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)

PATH=/home/kappa/bin​:/usr/local/sbin​:/usr/local/bin​:/usr/sbin​:/usr/bin​:/sbin​:/bin​:/usr/gam
es

 PERLLIB=/site/lib
 PERL\_BADLANG \(unset\)
 SHELL=/usr/bin/zsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant