[cvs] bogofilter/src lexer_v3.l,1.18,1.19

Matthias Andree matthias.andree at gmx.de
Mon May 19 21:32:26 CEST 2003


m-a at users.sourceforge.net writes:

> Index: lexer_v3.l
> ===================================================================
> RCS file: /cvsroot/bogofilter/bogofilter/src/lexer_v3.l,v
> retrieving revision 1.18
> retrieving revision 1.19
> diff -u -d -r1.18 -r1.19
> --- lexer_v3.l	18 May 2003 14:37:50 -0000	1.18
> +++ lexer_v3.l	19 May 2003 17:57:17 -0000	1.19
> @@ -70,6 +70,7 @@
>  #include "msgcounts.h"
>  #include "textblock.h"
>  #include "token.h"
> +#include "xmalloc.h"
>  
>  #define YY_DECL token_t yylex(void)
>      YY_DECL;			/* declare function */
> @@ -262,7 +263,7 @@
>      char *chr = memchr(yytext, '<', yyleng);	/* find start of html tag */
>      size_t len = chr - yytext;
>      char *tmp;
> -    char *yycopy = alloca(yyleng);
> +    char *yycopy = xmalloc(yyleng + 1); /* +1 for NUL byte below */

BTW, this +1 was missing from the alloca, so this may have corrupted the stack...

-- 
Matthias Andree




More information about the bogofilter-dev mailing list