From: Don Armstrong Date: Thu, 1 Oct 2015 00:29:08 +0000 (-0700) Subject: handle receips state properly; check for unescaped output in mbox X-Git-Tag: release/2.6.0~216 X-Git-Url: https://git.donarmstrong.com/?p=debbugs.git;a=commitdiff_plain;h=79880fc0337d60e4ae4a931ee21ba328aaef6af9 handle receips state properly; check for unescaped output in mbox --- diff --git a/Debbugs/Log.pm b/Debbugs/Log.pm index dce86d5..6ff8ab2 100644 --- a/Debbugs/Log.pm +++ b/Debbugs/Log.pm @@ -289,6 +289,9 @@ sub read_record $record->{recips} = [split /\04/, $_, -1]; } $this->{state} = 'kill-body'; + $record->{start} = $logfh->tell+2; + $record->{stop} = $logfh->tell+2; + $record->{inner_file} = $this->{inner_file}; } elsif ($this->{state} eq 'autocheck') { $record->{text} .= "$_\n" unless $this->{inner_file}; next if !/^X-Debian-Bugs(-\w+)?: This is an autoforward from (\S+)/; diff --git a/t/07_bugreport.t b/t/07_bugreport.t index 0366be4..3600e1c 100644 --- a/t/07_bugreport.t +++ b/t/07_bugreport.t @@ -1,7 +1,7 @@ # -*- mode: cperl;-*- -use Test::More tests => 6; +use Test::More tests => 8; use warnings; use strict; @@ -84,6 +84,13 @@ ok($mech->content() =~ qr/Subject: Submitting a bug/i, ok($mech->content() =~ qr/^From /m, 'Starts with a From appropriately'); +$mech->get_ok('http://localhost:'.$port.'/?bug=1;mboxmaint=yes', + 'Page received ok'); +print STDERR $mech->content(); +ok($mech->content() !~ qr/[\x01\x02\x03\x05\x06\x07]/i, + 'No unescaped states'); + + # Other tests for bugs in the page should be added here eventually