From f5059ad6acf09d94f7ff593c51902243c1071816 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Tue, 11 Dec 2007 10:47:46 +0000 Subject: [PATCH] check to avoid potential seg git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6633 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_utils.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 5025ce2114..ebad8afc66 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -216,6 +216,10 @@ static inline switch_bool_t switch_strstr(char *s, char *q) char *p, *S = NULL, *Q = NULL; switch_bool_t tf = SWITCH_FALSE; + if (!s || !q) { + return SWITCH_FALSE; + } + if (strstr(s, q)) { return SWITCH_TRUE; }