From: Brian West Date: Wed, 12 Jul 2017 22:19:52 +0000 (-0500) Subject: FS-10495: [Modules] firing custom event with no sub class will crash freeswitch when... X-Git-Tag: v1.8.0~367 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=197bbd8cab5f22ade0e419f5022baf9625c4f8e8;p=thirdparty%2Ffreeswitch.git FS-10495: [Modules] firing custom event with no sub class will crash freeswitch when mod_fail2ban is loaded #resolve --- diff --git a/src/mod/event_handlers/mod_fail2ban/mod_fail2ban.c b/src/mod/event_handlers/mod_fail2ban/mod_fail2ban.c index f35c0ddace..8c0eb4bf12 100644 --- a/src/mod/event_handlers/mod_fail2ban/mod_fail2ban.c +++ b/src/mod/event_handlers/mod_fail2ban/mod_fail2ban.c @@ -79,7 +79,7 @@ static int fail2ban_logger(const char *message, char *user, char *ip) static void fail2ban_event_handler(switch_event_t *event) { - if (event->event_id == SWITCH_EVENT_CUSTOM) { + if (event->event_id == SWITCH_EVENT_CUSTOM && event->subclass_name) { if (strncmp(event->subclass_name, "sofia::register_attempt",23) == 0) { fail2ban_logger("A registration was attempted", switch_event_get_header(event, "to-user"), switch_event_get_header(event, "network-ip")); } else if (strncmp(event->subclass_name, "sofia::register_failure",23) == 0) {