From f0541c5f1275204273818b5839f518e2ef8ad561 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 28 Jun 2006 17:53:01 +0000 Subject: Fixed bug in IRC parser (random crash with malformed IRC messages) --- src/irc/irc-server.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/irc/irc-server.c') diff --git a/src/irc/irc-server.c b/src/irc/irc-server.c index 0422a3778..cd5b0b19b 100644 --- a/src/irc/irc-server.c +++ b/src/irc/irc-server.c @@ -765,9 +765,14 @@ server_msgq_flush () if (ptr_data[0] == ':') { pos = strchr (ptr_data, ' '); - pos[0] = '\0'; - host = ptr_data + 1; - pos++; + if (pos) + { + pos[0] = '\0'; + host = ptr_data + 1; + pos++; + } + else + pos = ptr_data; } else pos = ptr_data; -- cgit v1.2.3