From 68fb067b6dc1a2153205ec8b210813a610d66d24 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 2 Apr 2009 16:38:47 -0500 Subject: Putting in some protection from crazy values --- libindicate/server.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libindicate') 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; -- cgit v1.2.3