From d327a0dd5a25f2495177c2cc4712b6227bedc305 Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 3 Feb 2013 17:19:10 +0000 Subject: [PATCH] Fixed crash on receiving dataform --- src/xmpp/capabilities.c | 6 ++++-- src/xmpp/stanza.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xmpp/capabilities.c b/src/xmpp/capabilities.c index fa87ced5..30844afc 100644 --- a/src/xmpp/capabilities.c +++ b/src/xmpp/capabilities.c @@ -153,8 +153,10 @@ caps_create_sha1_str(xmpp_stanza_t * const query) g_string_append(s, "<"); curr_value = g_slist_next(curr_value); } - curr_field = g_slist_next(curr_value); + curr_field = g_slist_next(curr_field); } + + curr = g_slist_next(curr); } EVP_MD_CTX mdctx; @@ -176,7 +178,7 @@ caps_create_sha1_str(xmpp_stanza_t * const query) g_slist_free_full(identities, free); g_slist_free_full(features, free); g_slist_free_full(form_names, free); - g_hash_table_destroy(forms); + //g_hash_table_destroy(forms); return result; } diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index bac88826..5b0aab3f 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -553,7 +553,7 @@ stanza_create_form(xmpp_stanza_t * const stanza) char *var = xmpp_stanza_get_attribute(child, "var"); // handle FORM_TYPE - if (g_strcmp0(var, "FORM_TYPE")) { + if (g_strcmp0(var, "FORM_TYPE") == 0) { xmpp_stanza_t *value = xmpp_stanza_get_child_by_name(child, "value"); char *value_text = xmpp_stanza_get_text(value); result->form_type = strdup(value_text);