From f201866909d36f988747115360b045d421f58346 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Thu, 10 Sep 2009 08:53:41 -0700 Subject: [PATCH] Ditch \r and \n in status fields (closes: #545895) --- Debbugs/Status.pm | 13 ++++++++++++- debian/changelog | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Debbugs/Status.pm b/Debbugs/Status.pm index 05275403..5b6e9dcf 100644 --- a/Debbugs/Status.pm +++ b/Debbugs/Status.pm @@ -232,7 +232,11 @@ sub read_bug{ for my $line (@lines) { if ($line =~ /(\S+?): (.*)/) { my ($name, $value) = (lc $1, $2); - $data{$namemap{$name}} = $value if exists $namemap{$name}; + # this is a bit of a hack; we should never, ever have \r + # or \n in the fields of status. Kill them off here. + # [Eventually, this should be superfluous.] + $value =~ s/[\r\n]//g; + $data{$namemap{$name}} = $value if exists $namemap{$name}; } } for my $field (keys %fields) { @@ -522,6 +526,13 @@ sub makestatus { } } + # this is a bit of a hack; we should never, ever have \r or \n in + # the fields of status. Kill them off here. [Eventually, this + # should be superfluous.] + for my $field (keys %newdata) { + $newdata{$field} =~ s/[\r\n]//g if defined $newdata{$field}; + } + if ($version == 1) { for my $field (@v1fieldorder) { if (exists $newdata{$field} and defined $newdata{$field}) { diff --git a/debian/changelog b/debian/changelog index 2fa786d0..8dc1bf31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ debbugs (2.4.2~exp1) experimental; urgency=low * Allow (almost) exactly what RFC2822 allows in comments (closes: #497144) * Fix problem with non-existant /etc/debbugs/config + * Ditch \r and \n in status fields (closes: #545895) -- Don Armstrong Wed, 26 Aug 2009 21:32:53 -0700 -- 2.39.5