From 5331a6145ba782ba7a1479749309c08707c9528f Mon Sep 17 00:00:00 2001 From: TingPing Date: Sun, 17 Nov 2013 11:57:13 -0500 Subject: Fix crash with negative timestamp in banlist Closes #841 --- src/common/inbound.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') 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) -- cgit 1.4.1