Quoting Andrew Hood <[EMAIL PROTECTED]>:

> Bert Wesarg wrote:
> > Hi all,
> >
> > I'm getting an buffer overflow error with recent GCC (ubuntu 4.3.2)
> > and -O3 optimization. The new cool feature is called _FORTIFY_SOURCE
> > (maybe). This checks at runtime buffer bounds within str*() and mem*()
> > functions. The problem that hits me is in regularExpr.c. The function
> > makeDelimiterTable() expects the second argument to be of type
> > 'unsigned char[256]' but the declaration is only 'unsigned char *'.
> > memset() is that called with a length parameter of 256 and the
> > internal checks fails because the length of the arguments is not
> > known. If I declare this function with the 'unsigned char[256]' all
> > works as expected. The question I have now is: can all supported
> > platforms this syntax or is this purely my problem? I can disable
> > these checks with -U_FORTIFY_SOURCE.
>
> Looking at the source I'd guess all the occurrences of "256" should be
> UCHAR_MAX+1, and there would appear to be no reason to change the
> function definition to "unsigned char[UCHAR_MAX+1]"

Sounds like a typedef would be in order, perhaps:

  typedef unsigned char UCharToUCharTable[UCHAR_MAX+1]

Would this work?

Tony
-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to