diff options
Diffstat (limited to 'src/plugins/script')
-rw-r--r-- | src/plugins/script/script-repo.c | 6 | ||||
-rw-r--r-- | src/plugins/script/script.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/script/script-repo.c b/src/plugins/script/script-repo.c index df947e098..43376a9fa 100644 --- a/src/plugins/script/script-repo.c +++ b/src/plugins/script/script-repo.c @@ -122,6 +122,9 @@ script_repo_search_by_name (const char *name) { struct t_script_repo *ptr_script; + if (!name) + return NULL; + for (ptr_script = scripts_repo; ptr_script; ptr_script = ptr_script->next_script) { @@ -144,6 +147,9 @@ script_repo_search_by_name_ext (const char *name_with_extension) { struct t_script_repo *ptr_script; + if (!name_with_extension) + return NULL; + for (ptr_script = scripts_repo; ptr_script; ptr_script = ptr_script->next_script) { diff --git a/src/plugins/script/script.c b/src/plugins/script/script.c index 16481c0d4..553ac3765 100644 --- a/src/plugins/script/script.c +++ b/src/plugins/script/script.c @@ -67,6 +67,9 @@ script_language_search (const char *language) { int i; + if (!language) + return -1; + for (i = 0; i < SCRIPT_NUM_LANGUAGES; i++) { if (strcmp (script_language[i], language) == 0) @@ -88,6 +91,9 @@ script_language_search_by_extension (const char *extension) { int i; + if (!extension) + return -1; + for (i = 0; i < SCRIPT_NUM_LANGUAGES; i++) { if (strcmp (script_extension[i], extension) == 0) |