about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2021-03-25 16:35:43 +0100
committerMichael Vetter <jubalh@iodoru.org>2021-03-25 16:35:43 +0100
commite09f3fb615464e50269d0e8a7b05ba089aafd2b2 (patch)
tree283f7927dee6e7ca25f09f4458770b60d58ccec4
parent44343a5c376a75049625c53c4db9e8d51ca8ff8d (diff)
downloadprofani-tty-e09f3fb615464e50269d0e8a7b05ba089aafd2b2.tar.gz
avatar: make _avatar_request_item_result_handler safer
-rw-r--r--src/xmpp/avatar.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xmpp/avatar.c b/src/xmpp/avatar.c
index 1bbda806..6adcaa24 100644
--- a/src/xmpp/avatar.c
+++ b/src/xmpp/avatar.c
@@ -224,6 +224,10 @@ _avatar_request_item_result_handler(xmpp_stanza_t* const stanza, void* const use
     }
 
     char* buf = xmpp_stanza_get_text(st_data);
+    if (!buf) {
+        return 1;
+    }
+
     gsize size;
     gchar* de = (gchar*)g_base64_decode(buf, &size);
     free(buf);