pidgin: eddf5e6f: Fix a crash in Finch < 2.7.0 with purple...

sadrul at pidgin.im sadrul at pidgin.im
Mon Jul 5 13:21:07 EDT 2010


----------------------------------------------------------------------
Revision: eddf5e6f686395b6be5b68a927d643ad2eb0e827
Parent:   a5a767b6c9bd015919c9b062e995ac8e6d075db6
Author:   sadrul at pidgin.im
Date:     07/05/10 11:49:57
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/eddf5e6f686395b6be5b68a927d643ad2eb0e827

Changelog: 

Fix a crash in Finch < 2.7.0 with purple >= 2.7.0.

The crash would happen if purple_sound_play_event is called for
GOT_ATTENTION event. Finch itself doesn't do it, but a plugin might.

Changes against parent a5a767b6c9bd015919c9b062e995ac8e6d075db6

  patched  finch/gntsound.c

-------------- next part --------------
============================================================
--- finch/gntsound.c	84f925930968ae6a36e2f8099893fda97c7437e7
+++ finch/gntsound.c	c23638a2e671e961f16e64dcaa93cec9e5322e69
@@ -577,7 +577,8 @@ finch_sound_play_event(PurpleSoundEventI
 	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;
 	}


More information about the Commits mailing list