From 4b5a759ce7aba05462493230dc79b0124ca60afd Mon Sep 17 00:00:00 2001 From: LDA Date: Tue, 22 Oct 2024 10:26:38 +0200 Subject: [PATCH] [FIX] Fix uninitialised variables I'm not sure why Debian's GCC didn't catch this, but NetBSD's did. Another reason to add CI checks for NetBSD, then, though I am not sure how to do it safely through VMs(and I doubt Docker/Podman would help me for weird architectures). Hm. --- src/XMPPThread/Stanzas/Message.c | 4 ++-- src/XMPPThread/Stanzas/Presence.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/XMPPThread/Stanzas/Message.c b/src/XMPPThread/Stanzas/Message.c index b9c5810..cd606dc 100644 --- a/src/XMPPThread/Stanzas/Message.c +++ b/src/XMPPThread/Stanzas/Message.c @@ -230,8 +230,8 @@ MessageStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr) if (StrEquals(type, "error")) { - char *type, *text, *user, *parsee; - char *message, *room; + char *type = NULL, *text = NULL, *user = NULL, *parsee = NULL; + char *message = NULL, *room = NULL; from = HashMapGet(stanza->attrs, "from"); to = HashMapGet(stanza->attrs, "to"); diff --git a/src/XMPPThread/Stanzas/Presence.c b/src/XMPPThread/Stanzas/Presence.c index 2885714..12c06cd 100644 --- a/src/XMPPThread/Stanzas/Presence.c +++ b/src/XMPPThread/Stanzas/Presence.c @@ -156,7 +156,7 @@ PresenceStanza(ParseeData *args, XMLElement *stanza, XMPPThread *thr) char *trim = ParseeTrimJID(jid); char *from = NULL; char *room = ParseeGetBridgedRoom(args, stanza); - char *decode_from, *real_matrix; + char *decode_from = NULL, *real_matrix = NULL; char *matrix_user_pl = ParseeEncodeJID(args->config, trim, false); char *affiliation = item ? HashMapGet(item->attrs, "affiliation") : NULL; char *role = item ? HashMapGet(item->attrs, "role") : NULL;