From 94a84cdd989b53b6d835d21333e57c9559848393 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Fri, 16 Jan 2009 18:33:38 +0100 Subject: [PATCH] Reject SCAN UMODES if invalid parameters are given. --- modules/m_scan.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/m_scan.c b/modules/m_scan.c index f0ce7d870..bb90d559d 100644 --- a/modules/m_scan.c +++ b/modules/m_scan.c @@ -135,6 +135,12 @@ scan_umodes(struct Client *client_p, struct Client *source_p, int parc, return -1; } + if (parv[2][0] != '+' && parv[2][0] != '-') + { + sendto_one_notice(source_p, ":SCAN UMODES: umodes parameter must start with '+' or '-'"); + return -1; + } + for (c = parv[2]; *c; c++) { switch(*c) @@ -170,6 +176,16 @@ scan_umodes(struct Client *client_p, struct Client *source_p, int parc, list_max = atoi(parv[++i]); else if (!irccmp(parv[i], "mask")) mask = parv[++i]; + else + { + sendto_one_notice(source_p, ":SCAN UMODES: invalid parameters"); + return -1; + } + } + else + { + sendto_one_notice(source_p, ":SCAN UMODES: invalid parameters"); + return -1; } } if (target_list == &global_client_list && list_users)