about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-01-16 14:17:46 -0500
committerKylie McClain <kylie@somas.is>2022-01-16 21:04:13 -0500
commit55345bd6b55944a9ad935a3c3cd46805adbd1769 (patch)
tree53b356548ffc85b52659b3b47052253bc53ba641
parentUse Cold for away notices in queries (diff)
downloadcatgirl-55345bd6b55944a9ad935a3c3cd46805adbd1769.tar.gz
catgirl-55345bd6b55944a9ad935a3c3cd46805adbd1769.zip
Avoid sending null byte in SASL PLAIN
Woops! BASE64_SIZE is the size of the string buffer. Somehow ergo
is the only server software (that I know of) to reject the accidental
null byte.

Reported by smlavine.
-rw-r--r--handle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/handle.c b/handle.c
index 94c4cbb..1a004c4 100644
--- a/handle.c
+++ b/handle.c
@@ -219,7 +219,7 @@ static void handleAuthenticate(struct Message *msg) {
 	char b64[BASE64_SIZE(sizeof(buf))];
 	base64(b64, buf, len);
 	ircFormat("AUTHENTICATE ");
-	ircSend(b64, BASE64_SIZE(len));
+	ircSend(b64, BASE64_SIZE(len) - 1);
 	ircFormat("\r\n");
 
 	explicit_bzero(b64, sizeof(b64));