Update of /cvsroot/popfile/engine/Classifier
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8515/Classifier
Modified Files:
Tag: b0_22_2
MailParse.pm
Log Message:
Fix bug 1423872 which would cause a POPFile crash if a quoted-printable string contained an encoded NUL (i.e. =00). This occurred because the DBI layer would crash
Index: MailParse.pm
===================================================================
RCS file: /cvsroot/popfile/engine/Classifier/MailParse.pm,v
retrieving revision 1.216.4.3
retrieving revision 1.216.4.4
diff -C2 -d -r1.216.4.3 -r1.216.4.4
*** MailParse.pm 6 Feb 2006 15:15:52 -0000 1.216.4.3
--- MailParse.pm 6 Feb 2006 19:33:32 -0000 1.216.4.4
***************
*** 1639,1642 ****
--- 1639,1643 ----
}
$line = decode_qp( $line );
+ $line =~ s/\x00/NUL/g;
}
***************
*** 1875,1884 ****
$output .= $pre unless ($last_is_encoded && defined($atom) # Per RFC 2047 section 6.2
&& $pre =~ /^[\t ]+$/);
!
if (defined($atom)) {
if ($encoding eq "B" || $encoding eq "b") {
!
$value = decode_base64( $value );
!
# for Japanese header
if ($lang eq 'Nihongo') {
--- 1876,1885 ----
$output .= $pre unless ($last_is_encoded && defined($atom) # Per RFC 2047 section 6.2
&& $pre =~ /^[\t ]+$/);
!
if (defined($atom)) {
if ($encoding eq "B" || $encoding eq "b") {
!
$value = decode_base64( $value );
!
# for Japanese header
if ($lang eq 'Nihongo') {
***************
*** 1890,1894 ****
$value =~ s/\_/=20/g;
$value = decode_qp( $value );
!
# for Japanese header
if ($lang eq 'Nihongo') {
--- 1891,1896 ----
$value =~ s/\_/=20/g;
$value = decode_qp( $value );
! $value =~ s/\x00/NUL/g;
!
# for Japanese header
if ($lang eq 'Nihongo') {
***************
*** 1902,1909 ****
$output .= $value || '';
}
!
# grab the unmatched tail (thanks to /gc and \G)
$output .= $1 if ($mystring =~ m/\G(.*)/g);
!
return $output;
}
--- 1904,1911 ----
$output .= $value || '';
}
!
# grab the unmatched tail (thanks to /gc and \G)
$output .= $1 if ($mystring =~ m/\G(.*)/g);
!
return $output;
}
|