~ubuntu-branches/ubuntu/utopic/bmf/utopic

« back to all changes in this revision

Viewing changes to debian/patches/40-patch-lex.c

  • Committer: Package Import Robot
  • Author(s): Jari Aalto
  • Date: 2012-02-13 02:48:03 UTC
  • Revision ID: package-import@ubuntu.com-20120213024803-w8pckhxogpxalgtm
Tags: 0.9.4-6
* debian/compat
  - Update to 9
* debian/control
  - (Build-Depends): Update to debhelper 9, dpkg-dev 1.16.1.
  - (Standards-Version): Update to 3.9.2.
  - Tweak description to address lintian warning.
* debian/copyright
  - (X-*): Add headers Vcs and Bugs.
* debian/patches
  - (40): New. Fix for folded headers.
* debian/rules
  - Remove unnecessary rules.
  - Use hardened CFLAGS (release goal).
    http://wiki.debian.org/ReleaseGoals/SecurityHardeningBuildFlags

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Subject: Fix for RFC822 folded header line field
 
2
From: https://sourceforge.net/tracker/?func=detail&aid=2816230&group_id=63555&atid=504404
 
3
 
 
4
$MirOS: ports/mailnews/bmf/patches/patch-lex_c,v 1.1 2009/07/03 09:14:12 tg Exp $
 
5
--- a/lex.c.orig        Sun Oct 20 20:28:53 2002
 
6
+++ a/lex.c     Fri Jul  3 09:06:51 2009
 
7
@@ -682,7 +682,7 @@ again:
 
8
 void lex_passthru( lex_t* pthis, bool_t is_spam, double hits )
 
9
 {
 
10
     char   szbuf[256];
 
11
-    bool_t in_headers = true;
 
12
+    bool_t ign_header = false;
 
13
 
 
14
     assert( pthis->bom < pthis->buflen && pthis->eom <= pthis->buflen );
 
15
     assert( pthis->bom <= pthis->eom );
 
16
@@ -701,7 +701,7 @@ void lex_passthru( lex_t* pthis, bool_t 
 
17
     }
 
18
 
 
19
     /* existing headers */
 
20
-    while( in_headers && pthis->pos < pthis->eom )
 
21
+    while( pthis->pos < pthis->eom )
 
22
     {
 
23
         cpchar pbuf = pthis->pbuf + pthis->pos;
 
24
         uint len = 0;
 
25
@@ -722,9 +722,14 @@ void lex_passthru( lex_t* pthis, bool_t 
 
26
         }
 
27
  
 
28
         /* write header, ignoring existing spam headers */
 
29
-        if( strncasecmp( pbuf, "X-Spam-", 7 ) != 0 )
 
30
+        if( ign_header && (pbuf[0] == ' ' || pbuf[0] == '\t') )
 
31
+            /* continuation line of an ignored header */ ;
 
32
+        else if( strncasecmp( pbuf, "X-Spam-", 7 ) == 0 )
 
33
+            ign_header = true;
 
34
+        else
 
35
         {
 
36
             write( STDOUT_FILENO, pbuf, len );
 
37
+            ign_header = false;
 
38
         }
 
39
 
 
40
         pthis->pos += len;