don't strstr on null/blank strings.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7027 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris
2007-12-30 00:22:51 +00:00
parent 33bd22a308
commit 6c25cb4136
9 changed files with 13 additions and 13 deletions

View File

@@ -983,7 +983,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()
if ((mods = switch_xml_child(cfg, "modules"))) {
for (ld = switch_xml_child(mods, "load"); ld; ld = ld->next) {
const char *val = switch_xml_attr_soft(ld, "module");
if (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT)) {
if (switch_strlen_zero(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val);
continue;
}
@@ -1003,7 +1003,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()
if ((mods = switch_xml_child(cfg, "modules"))) {
for (ld = switch_xml_child(mods, "load"); ld; ld = ld->next) {
const char *val = switch_xml_attr_soft(ld, "module");
if (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT)) {
if (switch_strlen_zero(val) || (strchr(val, '.') && !strstr(val, ext) && !strstr(val, EXT))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Invalid extension for %s\n", val);
continue;
}
@@ -1043,7 +1043,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_init()
continue;
}
if (!strstr(fname, ext) && !strstr(fname, EXT)) {
if (switch_strlen_zero(fname) || (!strstr(fname, ext) && !strstr(fname, EXT))) {
continue;
}