Mail Archives: djgpp-workers/2002/02/20/16:46:06
On Wed, 20 Feb 2002, Eli Zaretskii wrote:
> On Wed, 20 Feb 2002, Juan Manuel Guerrero wrote:
> > It works OK as long as some kind of windows is used as dpmi server.
> > As soon as cwsdpmi is used, bison dies with an error=0004.
> > The reason is that strlwr() does not check if the passed pointer
> > is a NULL pointer. In this case the while-loop derefences a NULL pointer
> > producing the SIGSEGV. This is the reason why for certain combinations
> > of command-line options bison 1.32/33 breaks on plain dos.
> > The small patch below will fix this for strlwr and strupr (suffers from the
> > same bug).
>
> I think it is wrong to patch string-related library functions to protect
> them from NULL pointers. ALL string-related functions have the same
> problem. It is programmer's responsibility to avoid passing NULL
> pointers to library functions, except in those cases where the function
> is explicitly documented to be able to accept NULL pointers.
>
> So I think the real fix should be in Bison, not in the library.
OK. Fixed in bison and patch submitted to bison maintainers.
Regards,
Guerrero, Juan Manuel
- Raw text -