From 50167ca96f20bf60d6b12f9dfe12e22a1ce561d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 15 Jan 2022 09:54:39 +0100 Subject: [PATCH] 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. --- src/plugins/relay/relay-auth.c | 5 +++-- 1 file 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; } /*