FS-8537: Passing nil to various lua functions causes segfault

Various functions exposed via lua do not check their parameters for null
causing freeswitch to segfault.

This change adds checking for null parameters and returns an error
instead of segfaulting.
This commit is contained in:
Mark Lipscombe committed 2015-11-15 10:43:09 +11:00
1 parent de7a123c8b
commit 4e9977507d
4 files changed
+63 -18

No files matched your search

+5
View File
@@ -996,6 +996,11 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
switch_bool_t rval = SWITCH_FALSE;
const char *err = NULL;
if (zstr(to)) {
err = "No to address specified";
goto end;
}
if (!zstr(file) && !zstr(convert_cmd) && !zstr(convert_ext)) {
if ((ext = strrchr(file, '.'))) {
dupfile = strdup(file);