summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-11-13 09:06:34 +0100
committerSébastien Helleu <flashcode@flashtux.org>2021-11-13 09:06:34 +0100
commita3924a27a0314abd66adcd567909001ff3ade5e4 (patch)
tree53ebf741767e56e0deb302a60011636b27844f2f /src/plugins/irc
parentcbadaecc4f2e247995130c0ef12f6f9c646261bf (diff)
downloadweechat-a3924a27a0314abd66adcd567909001ff3ade5e4.zip
tests: add tests on some IRC SASL functions
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-sasl.c9
1 files changed, 9 insertions, 0 deletions
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;