1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Merge branch 'fix-gl-20' into 'security'

do not record topic change time when sender is blank

See merge request irssi/irssi!25
This commit is contained in:
Nei 2018-01-04 22:19:39 +00:00
commit 7bed781622

View File

@ -138,7 +138,13 @@ static void channel_change_topic(IRC_SERVER_REC *server, const char *channel,
g_free_not_null(chanrec->topic_by);
chanrec->topic_by = g_strdup(setby);
chanrec->topic_time = settime;
if (chanrec->topic_by == NULL) {
/* ensure invariant topic_time > 0 <=> topic_by != NULL.
this could be triggered by a topic command without sender */
chanrec->topic_time = 0;
} else {
chanrec->topic_time = settime;
}
signal_emit("channel topic changed", 1, chanrec);
}