diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-06-28 17:53:01 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-06-28 17:53:01 +0000 |
commit | f0541c5f1275204273818b5839f518e2ef8ad561 (patch) | |
tree | b02d1fecb02509c2c8c0f7e6b57032708fdb1a0a /src/irc/irc-server.c | |
parent | 37edc90d7f928d0af6d9d67e60158271adba2977 (diff) | |
download | weechat-f0541c5f1275204273818b5839f518e2ef8ad561.zip |
Fixed bug in IRC parser (random crash with malformed IRC messages)
Diffstat (limited to 'src/irc/irc-server.c')
-rw-r--r-- | src/irc/irc-server.c | 11 |
1 files changed, 8 insertions, 3 deletions
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; |