aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-04-02 16:38:47 -0500
committerTed Gould <ted@canonical.com>2009-04-02 16:38:47 -0500
commit68fb067b6dc1a2153205ec8b210813a610d66d24 (patch)
treed164b593d8f27918d9d2824548e5f97792a35d29
parent2f66ceb474f6d42368873742c99100b8c4ef62d4 (diff)
downloadlibayatana-indicator-68fb067b6dc1a2153205ec8b210813a610d66d24.tar.gz
libayatana-indicator-68fb067b6dc1a2153205ec8b210813a610d66d24.tar.bz2
libayatana-indicator-68fb067b6dc1a2153205ec8b210813a610d66d24.zip
Putting in some protection from crazy values
-rw-r--r--libindicate/server.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libindicate/server.c b/libindicate/server.c
index 4e47040..e6041de 100644
--- a/libindicate/server.c
+++ b/libindicate/server.c
@@ -488,6 +488,10 @@ get_next_id (IndicateServer * server)
static gboolean
show_interest (IndicateServer * server, gchar * sender, IndicateInterests interest)
{
+ if (!(interest > INDICATE_INTEREST_NONE && interest < INDICATE_INTEREST_LAST)) {
+ return FALSE;
+ }
+
/* g_debug("Someone is showing interest. %s in %d", sender, interest); */
IndicateServerInterestedFolk localfolk;
localfolk.sender = sender;
@@ -516,6 +520,10 @@ show_interest (IndicateServer * server, gchar * sender, IndicateInterests intere
static gboolean
remove_interest (IndicateServer * server, gchar * sender, IndicateInterests interest)
{
+ if (!(interest > INDICATE_INTEREST_NONE && interest < INDICATE_INTEREST_LAST)) {
+ return FALSE;
+ }
+
IndicateServerInterestedFolk localfolk;
localfolk.sender = sender;