commit - 41f75b69740bd205864bd34afbb65ab0a3776136
commit + be2e611680834cf469c31ff0a230f1bf6d55c554
blob - 2835b46f51f7bc6d19e59894f5bb43d8cef4cfcd
blob + 37b97d689e5ed900fac5bc86eb303a7190063e2a
--- src/ngircd/client.c
+++ src/ngircd/client.c
Generate_MyToken(client);
if (Client_HasMode(client, 'a'))
- strlcpy(client->away, DEFAULT_AWAY_MSG, sizeof(client->away));
+ client->away = strndup(DEFAULT_AWAY_MSG, CLIENT_AWAY_LEN - 1);
client->next = (POINTER *)My_Clients;
My_Clients = client;
assert( Client != NULL );
assert( Txt != NULL );
- strlcpy( Client->away, Txt, sizeof( Client->away ));
+ if (Client->away)
+ free(Client->away);
+
+ Client->away = strndup(Txt, CLIENT_AWAY_LEN - 1);
+
LogDebug("%s \"%s\" is away: %s", Client_TypeText(Client),
Client_Mask(Client), Txt);
} /* Client_SetAway */
if ((*Client)->account_name)
free((*Client)->account_name);
+ if ((*Client)->away)
+ free((*Client)->away);
if ((*Client)->cloaked)
free((*Client)->cloaked);
if ((*Client)->ipa_text)
blob - 71d413b2f01be419f8c72c997cb33ca620e01a7e
blob + c104a75b8fbb8ced91c1e0c4eee50e3a96f2f096
--- src/ngircd/client.h
+++ src/ngircd/client.h
char modes[CLIENT_MODE_LEN]; /* client modes */
int hops, token, mytoken; /* "hops" and "Token" (see SERVER command) */
bool oper_by_me; /* client is local IRC operator on this server? */
- char away[CLIENT_AWAY_LEN]; /* AWAY text (valid if mode 'a' is set) */
+ char *away; /* AWAY text (valid if mode 'a' is set) */
char flags[CLIENT_FLAGS_LEN]; /* flags of the client */
char *account_name; /* login account (for services) */
int capabilities; /* enabled IRC capabilities */