]> jfr.im git - irc/weechat/weechat.git/commitdiff
tests/relay: fix crash in tests on Alpine 3.18
authorSébastien Helleu <redacted>
Sat, 1 Jul 2023 07:43:56 +0000 (09:43 +0200)
committerSébastien Helleu <redacted>
Sat, 1 Jul 2023 07:55:01 +0000 (09:55 +0200)
ChangeLog.adoc
src/plugins/relay/irc/relay-irc.c
tests/unit/plugins/relay/irc/test-relay-irc.cpp

index 29cff299ab7ad9ab3a259b4aab7c00cdc86efab7..f142bc2a8448e2ce7ae1044bb3bb4cd61fff6d79 100644 (file)
@@ -13,6 +13,10 @@ For a list of important changes that require manual actions, please look at rele
 [[v4.0.2]]
 == Version 4.0.2 (under dev)
 
+Tests::
+
+  * relay: fix crash in tests on Alpine 3.18
+
 Build::
 
   * php: fix detection of PHP 8.2 on Alpine 3.18
index 23fe741044642a94ed03374795baccbdd7db2b9f..fdc6c79a1662d13135244a723df16c9cb60d6cdc 100644 (file)
@@ -206,7 +206,7 @@ relay_irc_sendf (struct t_relay_client *client, const char *format, ...)
     const char *str_message, *ptr_msg1, *ptr_msg2;
     struct t_hashtable *hashtable_in, *hashtable_out;
 
-    if (!client)
+    if (!client || !format)
         return;
 
     weechat_va_format (format);
index b530b3d3b3fbe744a9e30be00a54f3c8f553b5b3..f1fb2e53147d31781900cd1f39b001e6b3232451 100644 (file)
@@ -487,7 +487,6 @@ TEST(RelayIrc, RelayIrcMessageParse)
 
 TEST(RelayIrcWithClient, RelayIrcSendf)
 {
-
     relay_irc_sendf (NULL, NULL);
     relay_irc_sendf (NULL, "test");
     relay_irc_sendf (ptr_relay_client, NULL);