From: Egor Date: Thu, 25 Jan 2024 11:32:07 +0000 (+0200) Subject: allow AUTHENTICATE after registration X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=f218684550cd8fb2a908161b7de5de18818b7128;p=patchyircd.git allow AUTHENTICATE after registration why are so many clients so stupid? also don't leak the saslbuf --- diff --git a/src/irc.c b/src/irc.c index acf46a2..0acedf5 100644 --- a/src/irc.c +++ b/src/irc.c @@ -268,8 +268,6 @@ int processPacket(struct client_data *client, char *source, char *command, int a goto unknown; } } else if(strcmp(command, "AUTHENTICATE") == 0) { - if (is_registered(client)) - return err_alreadyregistered(client), sendbuf(client), 0; if (!args[0]) return err_needmoreparams(client, command), sendbuf(client), 0; if (client->username && client->username[0] != '~') diff --git a/src/net.c b/src/net.c index 7d471d9..10d42bd 100644 --- a/src/net.c +++ b/src/net.c @@ -136,6 +136,9 @@ void killConnectionPart2(struct client_data *cl) memset(cl->pass_reg, 0, strlen(cl->pass_reg)); free(cl->pass_reg); free(cl->peername); + if (cl->saslbuf) + memset(cl->saslbuf, 0, 1024); + free(cl->saslbuf); free(cl); }