aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-20 13:13:04 -0500
committerTed Gould <ted@canonical.com>2009-04-20 13:13:04 -0500
commit76d5d0d2ad09b22fd49ca49761a12554a1d6383c (patch)
tree8a0693835d47fb64b724dea8041657cc3088bbea
parent38c6ce2a36d6416016f64e5963deee29bc02f8b3 (diff)
downloadlibayatana-indicator-76d5d0d2ad09b22fd49ca49761a12554a1d6383c.tar.gz
libayatana-indicator-76d5d0d2ad09b22fd49ca49761a12554a1d6383c.tar.bz2
libayatana-indicator-76d5d0d2ad09b22fd49ca49761a12554a1d6383c.zip
Gaurding against setting bad interests
-rw-r--r--libindicate/listener.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libindicate/listener.c b/libindicate/listener.c
index fddeb71..bd3639d 100644
--- a/libindicate/listener.c
+++ b/libindicate/listener.c
@@ -1003,6 +1003,10 @@ interest_cb (DBusGProxy *proxy, GError *error, gpointer userdata)
void
indicate_listener_server_show_interest (IndicateListener * listener, IndicateListenerServer * server, IndicateInterests interest)
{
+ if (!(interest > INDICATE_INTEREST_NONE && interest < INDICATE_INTEREST_LAST)) {
+ return;
+ }
+
if (!server->interests[interest]) {
org_freedesktop_indicator_show_interest_async (server->proxy, interest_to_string(interest), interest_cb, server);
server->interests[interest] = TRUE;