Commit db687a4f authored by Richard Bayerle's avatar Richard Bayerle
Browse files

Add NULL checks to XML sent/received callbacks.

This fixes #113.
parent 94c8a403
......@@ -1795,15 +1795,22 @@ cleanup:
}
static void lurch_xml_sent_cb(PurpleConnection * gc_p, xmlnode ** stanza_pp) {
xmlnode * body_node_p = (void *) 0;
xmlnode * body_node_p = (void *) 0;
xmlnode * encrypted_node_p = (void *) 0;
char * node_name = (*stanza_pp)->name;
const char * type = xmlnode_get_attrib(*stanza_pp, "type");
char * node_name = (void *) 0;
const char * type = (void *) 0;
if (uninstall) {
return;
}
if (!stanza_pp || !*stanza_pp) {
return;
}
node_name = (*stanza_pp)->name;
type = xmlnode_get_attrib(*stanza_pp, "type");
if (!g_strcmp0(node_name, "message")) {
body_node_p = xmlnode_get_child(*stanza_pp, "body");
if (!body_node_p) {
......@@ -2115,13 +2122,19 @@ cleanup:
}
static void lurch_xml_received_cb(PurpleConnection * gc_p, xmlnode ** stanza_pp) {
char * node_name = (*stanza_pp)->name;
xmlnode * temp_node_p = (void *) 0;
char * node_name = (void *) 0;
if (uninstall) {
return;
}
if (!stanza_pp || !*stanza_pp) {
return;
}
node_name = (*stanza_pp)->name;
if (!g_strcmp0(node_name, "message")) {
temp_node_p = xmlnode_get_child(*stanza_pp, "encrypted");
if (temp_node_p) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment