diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-03-09 08:59:01 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-03-09 14:01:54 +1000 |
commit | 0d9a42dc0380d1583889b6b6521bd5a2451735d4 (patch) | |
tree | 6d23aff5e0150a0003981a7578ceaa57a328f6a4 | |
parent | 432a95032eb10f82fb59caa29e52d3f56dfb363c (diff) |
Xi: don't crash on a NULL property name, just return None.
strcmp doesn't like NULL-pointers.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | Xi/xiproperty.c | 6 |
1 files changed, 6 insertions, 0 deletions
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){ |