--- a/finch/gntsound.c Mon Jul 05 15:03:28 2010 +0000 +++ b/finch/gntsound.c Mon Jul 05 15:49:57 2010 +0000 @@ -577,7 +577,8 @@ if ((event == PURPLE_SOUND_BUDDY_ARRIVE) && mute_login_sounds) return; - if (event >= PURPLE_NUM_SOUNDS) { + if (event >= PURPLE_NUM_SOUNDS || + event >= G_N_ELEMENTS(sounds)) { purple_debug_error("sound", "got request for unknown sound: %d\n", event); return; }