diff options
author | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-04-27 18:08:44 +0000 |
---|---|---|
committer | michael <michael@82007160-df01-0410-b94d-b575c5fd34c7> | 2013-04-27 18:08:44 +0000 |
commit | 51e0c33f67ada9867d13bdc7f4b2cb6e050bc5bc (patch) | |
tree | edb8fa274901a1e37916235e99606fc3102966be /modules | |
parent | afa75315e54988e309eb1a52c5c1d4ed84e177f0 (diff) |
- m_list.c:do_list(): added sanity test for parv[1] being NULL
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@1897 82007160-df01-0410-b94d-b575c5fd34c7
Diffstat (limited to 'modules')
-rw-r--r-- | modules/m_list.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/modules/m_list.c b/modules/m_list.c index c2a33b8..5c5cf24 100644 --- a/modules/m_list.c +++ b/modules/m_list.c @@ -43,8 +43,8 @@ static void do_list(struct Client *source_p, int parc, char *parv[]) { - struct ListTask *lt; - int no_masked_channels; + struct ListTask *lt = NULL; + int no_masked_channels = 1; if (source_p->localClient->list_task != NULL) { @@ -59,13 +59,11 @@ do_list(struct Client *source_p, int parc, char *parv[]) lt->topicts_max = UINT_MAX; source_p->localClient->list_task = lt; - no_masked_channels = 1; - - if (parc > 1) + if (parc > 1 && !EmptyString(parv[1])) { char *opt, *save = NULL; - dlink_list *list; - int i, errors = 0; + dlink_list *list = NULL; + int i = 0, errors = 0; for (opt = strtoken(&save, parv[1], ","); opt != NULL; opt = strtoken(&save, NULL, ",")) |