From 124da1da5cd3ac85edd7f0e30f61ee842d49a6a4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 9 Mar 2009 08:59:01 +1000 Subject: [PATCH] Xi: don't crash on a NULL property name, just return None. strcmp doesn't like NULL-pointers. Signed-off-by: Peter Hutterer (cherry picked from commit 0d9a42dc0380d1583889b6b6521bd5a2451735d4) --- Xi/xiproperty.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c index 5aec6f872..26af3fc00 100644 --- a/Xi/xiproperty.c +++ b/Xi/xiproperty.c @@ -58,11 +58,17 @@ static long XIPropHandlerID = 1; /** * Return the type assigned to the specified atom or 0 if the atom isn't known * to the DIX. + * + * If name is NULL, None is returned. */ _X_EXPORT 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)