From: Anthony Minessale Date: Mon, 28 Mar 2011 14:49:48 +0000 (-0500) Subject: FS-3194 see comitted patch. I made the function assert rather than tolerate NULL... X-Git-Tag: v1.2-rc1~120^2~5^2~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=484a397d88ef72bb79f91b26857ff49df592f261;p=thirdparty%2Ffreeswitch.git FS-3194 see comitted patch. I made the function assert rather than tolerate NULL and fixed the imporper usage. --- diff --git a/src/include/switch_utils.h b/src/include/switch_utils.h index 7fcb1e8c75..1f65b0ff43 100644 --- a/src/include/switch_utils.h +++ b/src/include/switch_utils.h @@ -151,7 +151,11 @@ static inline char *switch_strchr_strict(const char *in, char find, const char * #endif static inline int switch_string_has_escaped_data(const char *in) { - const char *i = strchr(in, '\\'); + const char *i; + + switch_assert(in); + + i = strchr(in, '\\'); while (i && *i == '\\') { i++; diff --git a/src/switch_event.c b/src/switch_event.c index 56ee9e9a9c..b7687c2041 100644 --- a/src/switch_event.c +++ b/src/switch_event.c @@ -1565,6 +1565,10 @@ SWITCH_DECLARE(char *) switch_event_expand_headers(switch_event_t *event, const int nv = 0; char *gvar = NULL; + if (zstr(in)) { + return (char *) in; + } + nv = switch_string_var_check_const(in) || switch_string_has_escaped_data(in); if (!nv) {