From 0d9a42dc0380d1583889b6b6521bd5a2451735d4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 9 Mar 2009 08:59:01 +1000 Subject: Xi: don't crash on a NULL property name, just return None. strcmp doesn't like NULL-pointers. Signed-off-by: Peter Hutterer --- Xi/xiproperty.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index c961ea5b6..d633f5141 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -172,11 +172,17 @@ static long XIPropHandlerID = 1; /** * Return the atom assigned to the specified string or 0 if the atom isn't known * to the DIX. + * + * If name is NULL, None is returned. */ Atom XIGetKnownProperty(char *name) { int i; + + if (!name) + return None; + for (i = 0; i < (sizeof(dev_properties)/sizeof(struct dev_properties)); i++) { if (strcmp(name, dev_properties[i].name) == 0){ -- cgit v1.2.3