projects
/
platform
/
upstream
/
at-spi2-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5546b33
)
Fix crash if GetChildAtIndex is called with an invalid index
author
Mike Gorse
<mgorse@novell.com>
Mon, 31 May 2010 16:24:58 +0000
(12:24 -0400)
committer
Mike Gorse
<mgorse@novell.com>
Mon, 31 May 2010 16:24:58 +0000
(12:24 -0400)
registryd/registry.c
patch
|
blob
|
history
diff --git
a/registryd/registry.c
b/registryd/registry.c
index
f3728f8
..
8391971
100644
(file)
--- a/
registryd/registry.c
+++ b/
registryd/registry.c
@@
-494,8
+494,13
@@
impl_GetChildAtIndex (DBusConnection * bus,
reply = dbus_message_new_method_return (message);
dbus_message_iter_init_append (reply, &iter);
- ref = g_ptr_array_index (reg->apps, i);
- append_reference (&iter, ref->name, ref->path);
+ if (i < 0 || i >= reg->apps->len)
+ append_reference (&iter, SPI_DBUS_NAME_REGISTRY, SPI_DBUS_PATH_NULL);
+ else
+ {
+ ref = g_ptr_array_index (reg->apps, i);
+ append_reference (&iter, ref->name, ref->path);
+ }
return reply;
}