From: Egor Date: Thu, 19 Oct 2023 14:27:36 +0000 (+0300) Subject: fix crash with NULL peername X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=1e059b6456f432816a69a0a8595fef120b5eab1c;p=patchyircd.git fix crash with NULL peername --- diff --git a/src/irc.c b/src/irc.c index 274c726..b623b81 100644 --- a/src/irc.c +++ b/src/irc.c @@ -292,7 +292,7 @@ int processPacket(struct client_data *client, char *source, char *command, int a client->realname = mystrdup(args[3]); if (!client->realname) abort(); - client->hostname = mystrdup(!strcmp(client->peername, "127.0.0.1") ? "localhost" : hostname); + client->hostname = mystrdup(client->peername && !strcmp(client->peername, "127.0.0.1") ? "localhost" : hostname); if (!client->hostname) abort(); // Send welcome