Bail out of check_auto_reply() early if auto_str is NULL. This fixes a

crash after /SETAR -.

Reported by riderplus.


git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@234 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Kevin Easton
2013-03-01 12:33:00 +00:00
parent 17e3a91f03
commit 73269ea887
2 changed files with 27 additions and 25 deletions

View File

@@ -134,37 +134,37 @@ void fake (void)
int check_auto_reply(char *str)
{
char *p = NULL;
char *pat;
if (!str || !*str || !get_int_var(AUTO_RESPONSE_VAR))
char *p = NULL;
char *pat;
if (!str || !*str || !get_int_var(AUTO_RESPONSE_VAR) || !auto_str)
return 0;
p = LOCAL_COPY(auto_str);
if (p && *p)
while ((pat = next_arg(p, &p)))
{
while ((pat = next_arg(p, &p)))
switch(get_int_var(NICK_COMPLETION_TYPE_VAR))
{
switch(get_int_var(NICK_COMPLETION_TYPE_VAR))
{
case 3:
if (!my_stricmp(str, pat))
goto found_auto;
continue;
case 2:
if (wild_match(pat, str))
goto found_auto;
continue;
case 1:
if (stristr(str, pat))
goto found_auto;
continue;
default:
case 0:
if (!my_strnicmp(str, pat, strlen(pat)))
goto found_auto;
continue;
}
case 3:
if (!my_stricmp(str, pat))
goto found_auto;
continue;
case 2:
if (wild_match(pat, str))
goto found_auto;
continue;
case 1:
if (stristr(str, pat))
goto found_auto;
continue;
default:
case 0:
if (!my_strnicmp(str, pat, strlen(pat)))
goto found_auto;
continue;
}
}
return 0;
found_auto:
#ifdef GUI