From: Michael Jerris Date: Tue, 11 Dec 2007 10:47:46 +0000 (+0000) Subject: check to avoid potential seg X-Git-Tag: v1.0-rc1~1195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5059ad6acf09d94f7ff593c51902243c1071816;p=thirdparty%2Ffreeswitch.git check to avoid potential seg git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6633 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- 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; }