summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2013-11-17 11:57:13 -0500
committerTingPing <tingping@tingping.se>2013-11-17 11:57:13 -0500
commit5331a6145ba782ba7a1479749309c08707c9528f (patch)
tree3693bb0f6d0de13042ba72579768f4f888badb1a /src/common
parent5c872eb110e73701bea3cfab38f1e26f6371c8f2 (diff)
Fix crash with negative timestamp in banlist
Closes #841
Diffstat (limited to 'src/common')
-rw-r--r--src/common/inbound.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/common/inbound.c b/src/common/inbound.c
index 5b5fc8bc..8d51df94 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -1439,10 +1439,15 @@ inbound_banlist (session *sess, time_t stamp, char *chan, char *mask,
 	server *serv = sess->server;
 	char *nl;
 
-	if ((nl = strchr (time_str, '\n')))
-		*nl = 0;
-	if (stamp == 0)
+	if (stamp <= 0)
+	{
 		time_str = "";
+	}
+	else
+	{
+		if ((nl = strchr (time_str, '\n')))
+			*nl = 0;
+	}
 
 	sess = find_channel (serv, chan);
 	if (!sess)