/pidgin/main: e6fc6614b274: Fix some null pointer deferences

Gary Kramlich grim at reaperworld.com
Fri May 6 00:13:57 EDT 2016


Changeset: e6fc6614b2742087d2125935f5cdbfcba6199972
Author:	 Gary Kramlich <grim at reaperworld.com>
Date:	 2016-05-02 08:32 -0500
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/e6fc6614b274

Description:

Fix some null pointer deferences

diffstat:

 libpurple/protocols/gg/lib/dcc7.c             |  2 +-
 libpurple/protocols/jabber/jingle/transport.c |  4 ++--
 pidgin/gtkcertmgr.c                           |  2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diffs (45 lines):

diff --git a/libpurple/protocols/gg/lib/dcc7.c b/libpurple/protocols/gg/lib/dcc7.c
--- a/libpurple/protocols/gg/lib/dcc7.c
+++ b/libpurple/protocols/gg/lib/dcc7.c
@@ -333,7 +333,7 @@ static int gg_dcc7_reverse_connect(struc
 {
 	gg_debug_dcc(dcc, GG_DEBUG_FUNCTION, "** gg_dcc7_reverse_connect(%p)\n", dcc);
 
-	if (dcc->reverse) {
+	if (dcc && dcc->reverse) {
 		gg_debug_dcc(dcc, GG_DEBUG_MISC, "// gg_dcc7_reverse_connect() already reverse connection\n");
 		return -1;
 	}
diff --git a/libpurple/protocols/jabber/jingle/transport.c b/libpurple/protocols/jabber/jingle/transport.c
--- a/libpurple/protocols/jabber/jingle/transport.c
+++ b/libpurple/protocols/jabber/jingle/transport.c
@@ -91,7 +91,7 @@ jingle_transport_finalize (GObject *tran
 static void
 jingle_transport_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 {
-	g_return_if_fail(object != NULL);
+	g_return_if_fail(G_IS_OBJECT(object));
 	g_return_if_fail(JINGLE_IS_TRANSPORT(object));
 
 	switch (prop_id) {
@@ -104,7 +104,7 @@ jingle_transport_set_property (GObject *
 static void
 jingle_transport_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 {
-	g_return_if_fail(object != NULL);
+	g_return_if_fail(G_IS_OBJECT(object));
 	g_return_if_fail(JINGLE_IS_TRANSPORT(object));
 
 	switch (prop_id) {
diff --git a/pidgin/gtkcertmgr.c b/pidgin/gtkcertmgr.c
--- a/pidgin/gtkcertmgr.c
+++ b/pidgin/gtkcertmgr.c
@@ -336,7 +336,7 @@ tls_peers_mgmt_info_cb(GtkWidget *button
 	if (crt == NULL) {
 		purple_debug_warning("gtkcertmgr/tls_peers_mgmt",
 				"Unable to fetch certificate '%s': %s",
-				id, error->message);
+				id, error ? error->message : "unknown error");
 		g_clear_error(&error);
 		g_free(id);
 	}



More information about the Commits mailing list