From ee761e7f023da8e9ac00dff617e938125f8ce9bf Mon Sep 17 00:00:00 2001 From: Tim Cava Date: Fri, 28 Jun 2013 05:22:20 +0000 Subject: [PATCH] Skip malformed entries in abots.sav, which avoids two null dereferences found by Coverity. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@250 13b04d17-f746-0410-82c6-800466cd88b0 --- Changelog | 3 +++ dll/abot/autobot.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Changelog b/Changelog index da6d27c..2328e43 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,8 @@ [Changes 1.2c01] +* Skip malformed abots.sav entries in read_abot(), avoiding null + dereferences found by Coverity. (flashback) + * Ensure proper handling of % when /FSET DCC is used. (caf) * Improve robustness of CDCC save file loading. (caf) diff --git a/dll/abot/autobot.c b/dll/abot/autobot.c index d62116a..d736ed6 100644 --- a/dll/abot/autobot.c +++ b/dll/abot/autobot.c @@ -198,8 +198,12 @@ UserList *new; chop(buffer, 1); u = buffer; h = strchr(u, '!'); + if (!h) + continue; *h++ = 0; p = strchr(h, ','); + if (!p) + continue; *p++ = 0; if ((c = strchr(p, ','))) *c++ = 0;