xserver: Branch 'master'

Matthias Hopf mhopf at suse.de
Fri Nov 17 04:44:15 PST 2006


On Nov 14, 06 18:19:22 +0200, Daniel Stone wrote:
> On Tue, Nov 14, 2006 at 06:33:31AM -0800, Matthias Hopf wrote:
> >     Bug #9023: Only check mice for "mouse" or "void" if identifier is != NULL.
> > 
> > diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
> > index ffdca12..c0e21dd 100644
> > --- a/hw/xfree86/common/xf86Config.c
> > +++ b/hw/xfree86/common/xf86Config.c
> > @@ -1307,7 +1307,7 @@ checkCoreInputDevices(serverLayoutPtr se
> >       * events, unless a 'void' section is found, in which case the user
> >       * probably wants to run footless.
> >       */
> > -    for (i = servlayoutp->inputs; i->driver; i++) {
> > +    for (i = servlayoutp->inputs; i->identifier && i->driver; i++) {
> >  	if (!strcmp(i->driver, "void") || !strcmp(i->driver, "mouse")) {
> >  	    found = 1; break;
> >  	}
> 
> Hi,
> Unfortunately this is invalid, as identifier can, in some cases, be
> NULL.  We're much better off just always terminating that structure.

Hm. All cases I've seen so far set i->identifier explicitely to NULL at
the end of the list.

We *can* set i->driver to NULL in these cases as well, however, there
should be a global list end definition. As far as I read the code this
was i->identifier.

Thanks

Matthias

-- 
Matthias Hopf <mhopf at suse.de>       __        __   __
Maxfeldstr. 5 / 90409 Nuernberg    (_   | |  (_   |__         mat at mshopf.de
Phone +49-911-74053-715            __)  |_|  __)  |__  labs   www.mshopf.de



More information about the xorg mailing list