# HG changeset patch # User Stu Tomlinson # Date 1275072941 0 # Node ID c6577fa167950fd0b78c418834c058be26e1a48c # Parent eec2900b0eeeb0f219c644d06c5e2c9c6b7f6bbd 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 diff -r eec2900b0eee -r c6577fa16795 libpurple/protocols/qq/qq_base.c --- a/libpurple/protocols/qq/qq_base.c Fri May 28 14:53:47 2010 +0000 +++ b/libpurple/protocols/qq/qq_base.c Fri May 28 18:55:41 2010 +0000 @@ -588,9 +588,14 @@ 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; }