about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2019-04-24 15:20:54 +0200
committerMichael Vetter <jubalh@iodoru.org>2019-04-24 15:20:54 +0200
commita794dadfa960506b0653ea87de675bb42cfe1644 (patch)
treea4709ffa3bb4491341b23e597d8f9c5f4ad869ab /src
parent32a25179f361f4645105257f36122671f7153d1b (diff)
downloadprofani-tty-a794dadfa960506b0653ea87de675bb42cfe1644.tar.gz
OMEMO: Check if ID is present before using it
Fixes https://github.com/boothj5/profanity/issues/1079
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/omemo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/xmpp/omemo.c b/src/xmpp/omemo.c
index 4b77ef23..ccf3c55b 100644
--- a/src/xmpp/omemo.c
+++ b/src/xmpp/omemo.c
@@ -359,7 +359,11 @@ _omemo_receive_devicelist(xmpp_stanza_t *const stanza, void *const userdata)
         xmpp_stanza_t *device;
         for (device = xmpp_stanza_get_children(list); device != NULL; device = xmpp_stanza_get_next(device)) {
             const char *id = xmpp_stanza_get_id(device);
-            device_list = g_list_append(device_list, GINT_TO_POINTER(strtoul(id, NULL, 10)));
+            if (id != NULL) {
+               device_list = g_list_append(device_list, GINT_TO_POINTER(strtoul(id, NULL, 10)));
+            } else {
+               log_error("OMEMO: received device without ID");
+            }
         }
     }
     omemo_set_device_list(from, device_list);