summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-10-16 20:35:00 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-10-17 21:28:31 +0200
commitd2bd952210adbfe2618637582f4df8a8ca710d87 (patch)
tree69e1e84377e03c1f692d6f7ac0b8c6488f153496
parent9fbe18eb2790fbd99c0da176f6d14d204fd89d0a (diff)
downloadweechat-d2bd952210adbfe2618637582f4df8a8ca710d87.zip
tests: protect IRC message with quotes in command /server fakerecv
-rw-r--r--tests/unit/plugins/irc/test-irc-protocol.cpp2
-rw-r--r--tests/unit/plugins/irc/test-irc-server.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/plugins/irc/test-irc-protocol.cpp b/tests/unit/plugins/irc/test-irc-protocol.cpp
index 38dbd87a0..7fdeb037a 100644
--- a/tests/unit/plugins/irc/test-irc-protocol.cpp
+++ b/tests/unit/plugins/irc/test-irc-protocol.cpp
@@ -369,7 +369,7 @@ TEST_GROUP(IrcProtocolWithServer)
snprintf (str_command, sizeof (str_command),
"/command -buffer irc.server." IRC_FAKE_SERVER " irc "
- "/server fakerecv %s",
+ "/server fakerecv \"%s\"",
command);
run_cmd_quiet (str_command);
diff --git a/tests/unit/plugins/irc/test-irc-server.cpp b/tests/unit/plugins/irc/test-irc-server.cpp
index e2a33e155..db7a12c24 100644
--- a/tests/unit/plugins/irc/test-irc-server.cpp
+++ b/tests/unit/plugins/irc/test-irc-server.cpp
@@ -1048,7 +1048,7 @@ TEST_GROUP(IrcServerConnected)
snprintf (str_command, sizeof (str_command),
"/command -buffer irc.server." IRC_FAKE_SERVER " irc "
- "/server fakerecv %s",
+ "/server fakerecv \"%s\"",
command);
run_cmd_quiet (str_command);
}