Hey Jamey,

On Sat, Jun 12, 2010 at 05:23:09PM +0200, ext Jamey Sharp wrote:
> 
> On Sat, Jun 12, 2010 at 7:39 AM, Tiago Vignatti
> <tiago.vigna...@nokia.com> wrote:
> > Apparently memset doesn't complain if the memory area is null (addr) and
> > something is being written there. Even though, this patch guarantees that
> > nothing is written at 0x0 memory address.
> 
> I'm confused by this comment. Did you get a segfault, or what? What do
> you mean by "memset doesn't complain", and why is the patch necessary?
> 
> I've just checked POSIX and C99, and neither one specifies anything
> about memset's behavior when length is 0 and address is null. Seems
> like no correct implementation could possibly dereference the null
> pointer though...
> 

No, I didn't get a segfault. So this patch is not exactly necessarily.

I'm playing a bit with a static analysis tool, which complained about this
NULL pointer dereference. So maybe this patch stills valid as a matter to fix
only a bad habit of programming, right?


             Tiago
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to