MAXWORDLEN vs MAXTOKENLEN

David Relson relson at osagesoftware.com
Sun Dec 8 19:25:30 CET 2002


At 01:03 PM 12/8/02, Matthias Andree wrote:

>David Relson <relson at osagesoftware.com> writes:
>
> > Hi,
> >
> > Anybody know why we have two similar symbols with different values?
> >
> > lexer.h has:  #define MAXTOKENLEN 30
> > lexer.l has:  #define MAXWORDLEN  20
> >
> > lexer.l uses MAXWORDLEN to decide if the token is too long to return
> > graham.c uses MAXTOKENLEN as the length for tokens in the extrema array
>
>As per your analysis, one of these must go. Is this exploitable (buffer
>overrun) if you exchange the values BTW?

I'd go with MAXTOKENLEN, as it's the more accurate name, and the larger 
length.  That would add 10 bytes for each extrema entry when graham is 
being used.  I think we can afford the storage.

I'll change the code.








More information about the bogofilter-dev mailing list