summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNei <ailin.nemui@gmail.com>2018-01-04 22:19:39 +0000
committerNei <ailin.nemui@gmail.com>2018-01-04 22:19:39 +0000
commit7bed781622c8e336bc7c739109c0a07bf3a9c8e3 (patch)
treeab398fccadb5a676a1a50f06eb9dce1da6e5e5e6 /src
parentf5c3995feaf70b06225f6af4a126ba33adcd4f6c (diff)
parent54d453623d879ea83d0818a80bd14151192953ec (diff)
downloadirssi-7bed781622c8e336bc7c739109c0a07bf3a9c8e3.zip
Merge branch 'fix-gl-20' into 'security'
do not record topic change time when sender is blank See merge request irssi/irssi!25
Diffstat (limited to 'src')
-rw-r--r--src/irc/core/channel-events.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/irc/core/channel-events.c b/src/irc/core/channel-events.c
index b0bddab2..46bbd5fa 100644
--- a/src/irc/core/channel-events.c
+++ b/src/irc/core/channel-events.c
@@ -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);
}