summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-03-09 08:59:01 +1000
committerAdam Jackson <ajax@redhat.com>2009-03-27 15:25:24 -0400
commit124da1da5cd3ac85edd7f0e30f61ee842d49a6a4 (patch)
tree24394e367c5c36fc69ba7edfeee9f92b57d08240 /Xi
parentea9f51fd42ae0285aed707b7efa44c558dad4e4b (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> (cherry picked from commit 0d9a42dc0380d1583889b6b6521bd5a2451735d4)
Diffstat (limited to 'Xi')
-rw-r--r--Xi/xiproperty.c6
1 files changed, 6 insertions, 0 deletions
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)