mirror of
https://github.com/irssi/irssi.git
synced 2026-08-21 01:22:26 +02:00
Merge branch 'security' into 'master'
Security
Closes #10
See merge request !17
(cherry picked from commit 5e26325317)
This commit is contained in:
parent
68bb0c6e48
commit
5e46c6dda0
2 changed files with 13 additions and 7 deletions
|
|
@ -560,6 +560,9 @@ char *my_asctime(time_t t)
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
tm = localtime(&t);
|
tm = localtime(&t);
|
||||||
|
if (tm == NULL)
|
||||||
|
return g_strdup("???");
|
||||||
|
|
||||||
str = g_strdup(asctime(tm));
|
str = g_strdup(asctime(tm));
|
||||||
|
|
||||||
len = strlen(str);
|
len = strlen(str);
|
||||||
|
|
|
||||||
|
|
@ -54,23 +54,26 @@ static void nick_hash_add(CHANNEL_REC *channel, NICK_REC *nick)
|
||||||
|
|
||||||
static void nick_hash_remove(CHANNEL_REC *channel, NICK_REC *nick)
|
static void nick_hash_remove(CHANNEL_REC *channel, NICK_REC *nick)
|
||||||
{
|
{
|
||||||
NICK_REC *list;
|
NICK_REC *list, *newlist;
|
||||||
|
|
||||||
list = g_hash_table_lookup(channel->nicks, nick->nick);
|
list = g_hash_table_lookup(channel->nicks, nick->nick);
|
||||||
if (list == NULL)
|
if (list == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (list == nick || list->next == NULL) {
|
if (list == nick) {
|
||||||
g_hash_table_remove(channel->nicks, nick->nick);
|
newlist = nick->next;
|
||||||
if (list->next != NULL) {
|
|
||||||
g_hash_table_insert(channel->nicks, nick->next->nick,
|
|
||||||
nick->next);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
newlist = list;
|
||||||
while (list->next != nick)
|
while (list->next != nick)
|
||||||
list = list->next;
|
list = list->next;
|
||||||
list->next = nick->next;
|
list->next = nick->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_hash_table_remove(channel->nicks, nick->nick);
|
||||||
|
if (newlist != NULL) {
|
||||||
|
g_hash_table_insert(channel->nicks, newlist->nick,
|
||||||
|
newlist);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add new nick to list */
|
/* Add new nick to list */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue