Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-MIME CPAN distribution.

Report information
The Basics
Id: 91707
Status: resolved
Priority: 0/
Queue: Email-MIME

People
Owner: Nobody in particular
Requestors: gregoa [...] debian.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



From: gregoa [...] cpan.org
Subject: libemail-mime-perl: use of uninitialized values in Encode.pm and Header.pm
This bug has been forwarded from http://bugs.debian.org/733317 -->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->-->--> Package: libemail-mime-perl Version: 1.925-1 Severity: normal I see frequently this: Use of uninitialized value $header in pattern match (m//) at /usr/share/perl5/Email/MIME/Header.pm line 19 Use of uninitialized value $val in pattern match (m//) at /usr/share/perl5/Email/MIME/Encode.pm line 31 I can easily reproduce the "Encode.pm line 31". The warning shows up on headers similar to this: To: foo@example.org, =?Windows-1252?Q?G=F6ran_Haraldsson?= <goran.haraldsson@example.org> but not on this: To: foo <foo@example.org>, =?Windows-1252?Q?G=F6ran_Haraldsson?= <goran.haraldsson@example.org> ^^^^^ ^ I can produce a simple example code, if needed. Still, this patch: --- Encode.pm.orig 2013-11-08 13:01:07.000000000 +0100 +++ Encode.pm 2013-12-28 13:33:37.083303204 +0100 @@ -28,8 +28,8 @@ sub maybe_mime_encode_header { my ($header, $val, $charset) = @_; - return $val unless $val =~ /\P{ASCII}/ - || $val =~ /=\?/; + return $val unless $val && + ($val =~ /\P{ASCII}/ || $val =~ /=\?/); $header =~ s/^Resent-//; @@ -56,10 +56,10 @@ @addrs = map { my $phrase = $_->phrase; $_->phrase(mime_encode($phrase, $charset)) - if $phrase =~ /\P{ASCII}/; + if $phrase && $phrase =~ /\P{ASCII}/; my $comment = $_->comment; $_->comment(mime_encode($comment, $charset)) - if $comment =~ /\P{ASCII}/; + if $comment && $comment =~ /\P{ASCII}/; $_; } @addrs; --- removes some Encode.pm warnings. I suspect the Header.pm warning has a similar cause. What about this patch: --- Header.pm.orig 2013-11-08 13:01:07.000000000 +0100 +++ Header.pm 2013-12-28 13:51:49.000000000 +0100 @@ -16,7 +16,7 @@ my @header = $self->SUPER::header(@_); local $@; foreach my $header (@header) { - next unless $header =~ /=\?/; + next unless $header && $header =~ /=\?/; $header = $self->_header_decode_str($header); } return wantarray ? (@header) : $header[0]; --- -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (500, 'testing'), (99, 'unstable'), (59, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores) Locale: LANG=, LC_CTYPE= (charmap=ANSI_X3.4-1968) Shell: /bin/sh linked to /bin/bash Versions of packages libemail-mime-perl depends on: ii libemail-address-perl 1.900-1 ii libemail-messageid-perl 1.402-1 ii libemail-mime-contenttype-perl 1.017-1 ii libemail-mime-encodings-perl 1.315-1 ii libemail-simple-perl 2.201-1 ii libmime-types-perl 2.04-1 ii perl 5.18.1-5 libemail-mime-perl recommends no packages. libemail-mime-perl suggests no packages. -- no debconf information Cheers, -- Cristian <--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<--<-- Thanks in advance, gregor herrmann, Debian Perl Group
Subject: Re: [rt.cpan.org #91707] libemail-mime-perl: use of uninitialized values in Encode.pm and Header.pm
Date: Mon, 30 Dec 2013 22:53:28 -0500
To: gregor herrmann via RT <bug-Email-MIME [...] rt.cpan.org>
From: Ricardo Signes <rjbs [...] cpan.org>
* gregor herrmann via RT <bug-Email-MIME@rt.cpan.org> [2013-12-28T11:53:34] Show quoted text
> Subject: libemail-mime-perl: use of uninitialized values in Encode.pm and
Thanks, I'll look at reviewing applying this on my next pass through this queue, which should be pretty soon. -- rjbs
thanks, I've fixed this in a very slightly different way -- rjbs