[PATCH] list.h: don't crash when removing an element from a NULL list

Peter Hutterer peter.hutterer at who-t.net
Wed Jul 4 23:47:04 PDT 2012


On Wed, Jul 04, 2012 at 11:32:38PM -0700, Keith Packard wrote:
> Peter Hutterer <peter.hutterer at who-t.net> writes:
> 
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> > Keith, please merge this directly if you're happy with it.
> 
> It looks fine, but I don't see any place that this actually matters in
> current code?

no, but the selinux fix will need it (partially out of laziness, partially
to make the code nicer).

> (the more I see of these twisty list macros, the more I prefer
> open-coded lists though; wow this is hard to understand).

given how often we've found bugs in open-coded lists I disagree.
yes, they're hairy but they're tested, the macro behaves the same
everywhere. and if you really worry about the code being wrong, run it
through the pre-processor and it will look like an open-coded list.

Cheers,
  Peter


More information about the xorg-devel mailing list