diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-01-15 09:54:39 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-01-15 10:03:54 +0100 |
commit | 50167ca96f20bf60d6b12f9dfe12e22a1ce561d2 (patch) | |
tree | c41e845f43377d34202a61746e426aafb2568dd8 /src/plugins/relay/relay-auth.c | |
parent | b54d06630db4d804319e4d8f44d8bc1444f0f664 (diff) | |
download | weechat-50167ca96f20bf60d6b12f9dfe12e22a1ce561d2.zip |
relay: fix comparison of server nonce with UTF-8 chars (issue #1739)
There is no problem in practice because this server nonce is generated by
WeeChat itself and encoded to base64, so it never contains any UTF-8 char on
more than one byte.
Diffstat (limited to 'src/plugins/relay/relay-auth.c')
-rw-r--r-- | src/plugins/relay/relay-auth.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/relay/relay-auth.c b/src/plugins/relay/relay-auth.c index 05dde1630..af958d8f4 100644 --- a/src/plugins/relay/relay-auth.c +++ b/src/plugins/relay/relay-auth.c @@ -276,8 +276,9 @@ relay_auth_check_salt (struct t_relay_client *client, const char *salt_hexa) return (salt_hexa && client->nonce && (strlen (salt_hexa) > strlen (client->nonce)) - && (weechat_strncasecmp (salt_hexa, client->nonce, - strlen (client->nonce)) == 0)) ? 1 : 0; + && (weechat_strncasecmp ( + salt_hexa, client->nonce, + weechat_utf8_strlen (client->nonce)) == 0)) ? 1 : 0; } /* |