[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#565981: debbugs: Debbugs::MIME::parse doesn't handle PGP Signed messages with \r correctly



On Wed, 20 Jan 2010, Mike Hommey wrote:
> #532828 is an example of a bug with a PGP signed report message with
> \r. Debbugs::MIME::parse doesn't handle this case correctly, leading
> to the returned message being empty after it strips off
> RFC2440-style PGP clearsigning.
> 
>      # Strip off RFC2440-style PGP clearsigning.
>      if (@bodylines and $bodylines[0] =~ /^-----BEGIN PGP SIGNED/) {
> -	shift @bodylines while @bodylines and length $bodylines[0];
> +	shift @bodylines while @bodylines and $bodylines[0] =~ /\S/;

This is too broad. It should be:
              and length $bodylines[0] and $bodylines[0] ne qq(\r);

>  	shift @bodylines while @bodylines and $bodylines[0] !~ /\S/;
>  	for my $findsig (0 .. $#bodylines) {
>  	    if ($bodylines[$findsig] =~ /^-----BEGIN PGP SIGNATURE/) {


Don Armstrong

-- 
Democracy means simply the bludgeoning of the people by the people for
the people.
 -- Oscar Wilde

http://www.donarmstrong.com              http://rzlab.ucr.edu



Reply to: