Bug in lexer_v3

Evgeny Kotsuba evgen at shatura.laser.ru
Sat Jan 15 01:35:34 CET 2005


David Relson wrote:

>On Fri, 14 Jan 2005 05:12:07 +0300
>Evgeny Kotsuba wrote:
>  
>
>>Hi,
>>
>>I have just foud bug that seems is present  throw as min v 0.15.8
>>    
>>
>
>You're correct.  There's a problem.  Have you got a fix??
>  
>
I think I can't ;-)

>As a tip, it's easier to run "bogolexer -p < msg" to see what the parser
>is doing.
>  
>
>>PS: by the way, is there any global indicator This_is_header ?
>>    
>>
>
>Yes -- variable msg_header.  It's used in lexer_v3.l and lexer.c
>  
>
But bug is found!

Look at  lexer_v3.l
--------------------8<------------------------------------
<INITIAL>\n[[:blank:]]                { lineno += 1; }
<INITIAL>\n\n                    { enum mimetype type = get_content_type();
                          have_body = true;
                          msg_header = false;
                          clr_tag();
                          switch (type) {
                          case MIME_TEXT_HTML:    BEGIN HTML; break;
                          case MIME_MESSAGE:    yy_set_state_initial(); 
break;
                          default:        BEGIN TEXT;
                          }
                          return EOH;
                        }
--------------------8<------------------------------------
We set         msg_header = false;

and then can call   yy_set_state_initial();  where  set    msg_header = 
true;

So it seems to me
-                         msg_header = false;
                          clr_tag();
                          switch (type) {
                          case MIME_TEXT_HTML:    BEGIN HTML; break;
                          case MIME_MESSAGE:    yy_set_state_initial(); 
break;
                          default:        BEGIN TEXT;
                          }
+                        msg_header = false;
                          return EOH;

But remember - I don't understand anything in lexer and I can't run 
automatically all test

SY,
EK




More information about the bogofilter-dev mailing list