diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index ebf209dff0..073d329958 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -110,6 +110,11 @@ SWITCH_STANDARD_API(xml_locate_function) goto end; } + + if (stream->event && switch_event_get_header(stream->event, "http-host")) { + stream->write_function(stream, "Content-Type: text/xml\r\n\r\n"); + } + mydata = strdup(cmd); assert(mydata); diff --git a/src/mod/applications/mod_expr/mod_expr.c b/src/mod/applications/mod_expr/mod_expr.c index ea7f1ed3ef..addb2fd7da 100644 --- a/src/mod/applications/mod_expr/mod_expr.c +++ b/src/mod/applications/mod_expr/mod_expr.c @@ -51,7 +51,13 @@ SWITCH_STANDARD_API(expr_function) int err; char val[512] = "", *p; char *m_cmd = NULL; - size_t len = strlen(cmd) + 3; + size_t len; + + if (switch_strlen_zero(cmd)) { + goto error; + } + + len = strlen(cmd) + 3; m_cmd = malloc(len);