/pidgin/main: e38a9aa5b1f8: Gadu-Gadu: handle invalid debug prin...

Tomasz Wasilczyk <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: e38a9aa5b1f8d25c58a0a7da05b386f265cba6e3
Author:	 Tomasz Wasilczyk <[email protected]>
Date:	 2014-11-23 00:03 +0100
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/e38a9aa5b1f8

Description:

Gadu-Gadu: handle invalid debug prints. Refs #16471

diffstat:

 libpurple/protocols/gg/gg.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (18 lines):

diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -2369,6 +2369,14 @@ static void purple_gg_debug_handler(int 
 	PurpleDebugLevel purple_level;
 	char *msg = g_strdup_vprintf(format, args);
 
+	if (!msg) {
+		purple_debug_fatal("gg",
+			"failed to vprintf the following message: %s",
+			format ? format : "(null)\n");
+
+		return;
+	}
+
 	/* This is pretty pointless since the GG_DEBUG levels don't correspond to
 	 * the purple ones */
 	switch (level) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.