From a3924a27a0314abd66adcd567909001ff3ade5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 13 Nov 2021 09:06:34 +0100 Subject: tests: add tests on some IRC SASL functions --- src/plugins/irc/irc-sasl.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/plugins/irc') diff --git a/src/plugins/irc/irc-sasl.c b/src/plugins/irc/irc-sasl.c index 3795d3486..e96323e10 100644 --- a/src/plugins/irc/irc-sasl.c +++ b/src/plugins/irc/irc-sasl.c @@ -58,6 +58,9 @@ irc_sasl_mechanism_plain (const char *sasl_username, const char *sasl_password) char *answer_base64, *string; int length_username, length; + if (!sasl_username || !sasl_password) + return NULL; + answer_base64 = NULL; length_username = strlen (sasl_username); length = ((length_username + 1) * 2) + strlen (sasl_password) + 1; @@ -117,6 +120,12 @@ irc_sasl_mechanism_scram (struct t_irc_server *server, int server_key_size, server_signature_size, verifier_size; long number; + if (!server || !hash_algo || !data_base64 || !sasl_username + || !sasl_password) + { + return NULL; + } + answer_base64 = NULL; string = NULL; length = 0; -- cgit v1.2.3