pidgin: 70b2c1fe: Avoid a crash (null pointer dereference)...

nosnilmot at pidgin.im nosnilmot at pidgin.im
Fri May 28 15:02:04 EDT 2010


-----------------------------------------------------------------
Revision: 70b2c1feed72ab8c54c019933469cad3cdb2ba27
Ancestor: 65c85396adbbed0594b590e18c0f391f595f70a0
Author: nosnilmot at pidgin.im
Date: 2010-05-28T18:55:41
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/70b2c1feed72ab8c54c019933469cad3cdb2ba27

Modified files:
        libpurple/protocols/qq/qq_base.c

ChangeLog: 

Avoid a crash (null pointer dereference) in QQ if the server_time was not
parsed correctly, I have no idea if this will make QQ work better but it
can't be any worse.

Refs #10560, https://bugzilla.redhat.com/show_bug.cgi?id=531959


-------------- next part --------------
============================================================
--- libpurple/protocols/qq/qq_base.c	7a4971b102422fbf720cefd1bddf90f35eb6c5d0
+++ libpurple/protocols/qq/qq_base.c	d375832b25bf0e77490750027b80f1321a95957a
@@ -588,9 +588,14 @@ gboolean qq_process_keep_alive_2008(guin
 		inet_ntoa(qd->my_ip), qd->my_port);
 
 	tm_local = localtime(&server_time);
-	purple_debug_info("QQ", "Server time: %d-%d-%d, %d:%d:%d\n",
-			(1900 +tm_local->tm_year), (1 + tm_local->tm_mon), tm_local->tm_mday,
-			tm_local->tm_hour, tm_local->tm_min, tm_local->tm_sec);
+
+	if (tm_local != NULL)
+		purple_debug_info("QQ", "Server time: %d-%d-%d, %d:%d:%d\n",
+				(1900 +tm_local->tm_year), (1 + tm_local->tm_mon), tm_local->tm_mday,
+				tm_local->tm_hour, tm_local->tm_min, tm_local->tm_sec);
+	else
+		purple_debug_error("QQ", "Server time could not be parsed\n");
+
 	return TRUE;
 }
 


More information about the Commits mailing list