<<< Date Index >>>     <<< Thread Index >>>

Re: Few warnings in cvs



On 2006-11-14 16:20:24 +0100, Adam Wysocki wrote:
> --- regex.c~    2006-11-14 16:11:59.000000000 +0100
> +++ regex.c     2006-11-14 16:13:01.000000000 +0100
> @@ -2196,8 +2196,7 @@
>                      for (;;)
>                        {
>                          PATFETCH (c);
> -                        if (c == ':' || c == ']' || p == pend
> -                            || c1 == CHAR_CLASS_MAX_LENGTH)
> +                        if (c == ':' || c == ']' || p == pend)
>                            break;
>                          str[c1++] = c;
>                        }

AFAIK, this change may lead to a buffer overflow or infinite loop.
BTW, I don't think that using c1 (an unsigned char) as an index is
a good idea.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)