about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2022-05-26 18:49:14 +0200
committerGitHub <noreply@github.com>2022-05-26 18:49:14 +0200
commitfe0b7dac53423b6bf3db369c506aa3a9b6e70be3 (patch)
tree893afab99c75dc48c0d852151e24099e74fdeff3 /src
parentb4523d6c42825bda175663730001302adb21b95e (diff)
parent719f3fbee091fb2a6b4cbe07b0881fab2af2bbb4 (diff)
downloadprofani-tty-fe0b7dac53423b6bf3db369c506aa3a9b6e70be3.tar.gz
Merge pull request #1715 from MarcoPolo-PasTonMolo/fix/ox-discover-segfault
Fix segfault on `/ox discover`
Diffstat (limited to 'src')
-rw-r--r--src/xmpp/ox.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/xmpp/ox.c b/src/xmpp/ox.c
index da05af89..7f0304f5 100644
--- a/src/xmpp/ox.c
+++ b/src/xmpp/ox.c
@@ -325,11 +325,14 @@ _ox_metadata_result(xmpp_stanza_t* const stanza, void* const userdata)
 
     while (pubkeymetadata) {
         const char* fingerprint = xmpp_stanza_get_attribute(pubkeymetadata, STANZA_ATTR_V4_FINGERPRINT);
-        if (strlen(fingerprint) == KEYID_LENGTH) {
-            cons_show(fingerprint);
-        } else {
-            cons_show("OX: Wrong char size of public key");
-            log_error("[OX] Wrong chat size of public key %s", fingerprint);
+
+        if (fingerprint) {
+            if (strlen(fingerprint) == KEYID_LENGTH) {
+                cons_show(fingerprint);
+            } else {
+                cons_show("OX: Wrong char size of public key");
+                log_error("[OX] Wrong chat size of public key %s", fingerprint);
+            }
         }
         pubkeymetadata = xmpp_stanza_get_next(pubkeymetadata);
     }