[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



Package: debbugs
Severity: normal
Tags: patch

#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.

This apparently can have impact on the hyperestraier indexing, which uses
this function.

The attached patch should fix the problem.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.31-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
--- /org/bugs.debian.org/perl/Debbugs/MIME.pm	2010-01-06 07:54:36.000000000 +0000
+++ /home/glandium/Debbugs/MIME.pm	2010-01-20 11:06:24.000000000 +0000
@@ -120,7 +120,7 @@
 
     # 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/;
 	shift @bodylines while @bodylines and $bodylines[0] !~ /\S/;
 	for my $findsig (0 .. $#bodylines) {
 	    if ($bodylines[$findsig] =~ /^-----BEGIN PGP SIGNATURE/) {

Reply to: