]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3194 see comitted patch. I made the function assert rather than tolerate NULL...
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Mar 2011 14:49:48 +0000 (09:49 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Mar 2011 14:49:52 +0000 (09:49 -0500)
src/include/switch_utils.h
src/switch_event.c

index 7fcb1e8c75cd5b5e0c606e6e863b5475cdaad653..1f65b0ff437febd951f6f1a1147d3beaf078278f 100644 (file)
@@ -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++;
index 56ee9e9a9cde60e1b4a9d3241bd9be27bd8d2ed2..b7687c2041ed47d87b59cc200c6f68fac70907a1 100644 (file)
@@ -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) {