[PATCH] xfree86: check for NULL pointer before dereferences it in parser code

Florian Mickler florian at mickler.org
Sun Apr 18 05:26:30 PDT 2010


On Fri, 16 Apr 2010 11:19:05 -0700
Dan Nicholson <dbn.lists at gmail.com> wrote:

> On Fri, Apr 16, 2010 at 10:16 AM, Éric Piel <E.A.B.Piel at tudelft.nl> wrote:
> > ... and you probably want to check de is not NULL as well :-)
> 
> Actually, this function is only over called as the filter for scandir.
> I doubt that scandir will be passing it a NULL dirent, but I can't say
> that for sure.
> 
> --
> Dan

This is a classic case for putting some kind of assertion in
there to catch violations of the calling convention. No need to fork
control flow for this... 

cheers,
Flo 


More information about the xorg-devel mailing list