From 3203ee8f051c9af429b98c60cbd1350d4dd33095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 1 Jul 2023 09:43:56 +0200 Subject: [PATCH] tests/relay: fix crash in tests on Alpine 3.18 --- ChangeLog.adoc | 4 ++++ src/plugins/relay/irc/relay-irc.c | 2 +- tests/unit/plugins/relay/irc/test-relay-irc.cpp | 1 - 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 29cff299a..f142bc2a8 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -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 diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index 23fe74104..fdc6c79a1 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -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); diff --git a/tests/unit/plugins/relay/irc/test-relay-irc.cpp b/tests/unit/plugins/relay/irc/test-relay-irc.cpp index b530b3d3b..f1fb2e531 100644 --- a/tests/unit/plugins/relay/irc/test-relay-irc.cpp +++ b/tests/unit/plugins/relay/irc/test-relay-irc.cpp @@ -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);