From 4f4fb9e942d7c912746870fa15e1af281648c47f Mon Sep 17 00:00:00 2001 From: Chris Rienzo Date: Thu, 8 May 2014 11:30:53 -0400 Subject: [PATCH] CID: 1211951 mod_rayo - fix unlikely dereference of null pointer --- src/mod/event_handlers/mod_rayo/srgs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mod/event_handlers/mod_rayo/srgs.c b/src/mod/event_handlers/mod_rayo/srgs.c index 22ee02fd06..70d925e0fc 100644 --- a/src/mod/event_handlers/mod_rayo/srgs.c +++ b/src/mod/event_handlers/mod_rayo/srgs.c @@ -1,6 +1,6 @@ /* * mod_rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application - * Copyright (C) 2013, Grasshopper + * Copyright (C) 2013-2014, Grasshopper * * Version: MPL 1.1 * @@ -1242,6 +1242,10 @@ static int is_match_end(pcre *compiled_regex, const char *input) const char *search = strchr(search_set, input[input_size - 1]); /* start with last digit in input */ int i = 0; + if (!search) { + return 0; + } + /* For each digit in search_set, check if input + search_set digit is a potential match. If so, then this is not a match end. */