mirror of
https://github.com/profanity-im/profanity.git
synced 2024-09-22 19:45:54 -04:00
OMEMO: Check if ID is present before using it
Fixes https://github.com/boothj5/profanity/issues/1079
This commit is contained in:
parent
32a25179f3
commit
a794dadfa9
@ -359,7 +359,11 @@ _omemo_receive_devicelist(xmpp_stanza_t *const stanza, void *const userdata)
|
|||||||
xmpp_stanza_t *device;
|
xmpp_stanza_t *device;
|
||||||
for (device = xmpp_stanza_get_children(list); device != NULL; device = xmpp_stanza_get_next(device)) {
|
for (device = xmpp_stanza_get_children(list); device != NULL; device = xmpp_stanza_get_next(device)) {
|
||||||
const char *id = xmpp_stanza_get_id(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);
|
omemo_set_device_list(from, device_list);
|
||||||
|
Loading…
Reference in New Issue
Block a user