summaryrefslogtreecommitdiff
path: root/lib/frrscript.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-10-29 13:03:42 -0400
committerDonald Sharp <sharpd@nvidia.com>2021-11-01 07:29:10 -0400
commit821a877fd76c15f1ad754a9d7b71e174540cc414 (patch)
treeaffc6affa58a0b4205b10d853a8695a5820c84db /lib/frrscript.c
parent65a69156b247a71bb3b429ea665334f36d06fba7 (diff)
lib: Return Null when we have an empty string for script name
The script entries were being stored in a hash lookup with the script name a pre-defined array of characters. The hash lookup is succeeding since it is auto-installed at script start time irrelevant if there is a handler function. Modify the code so that if the scriptname is an empty string "\0" just return a NULL so that zebra does not attempt to actually load up the script Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/frrscript.c')
-rw-r--r--lib/frrscript.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/frrscript.c b/lib/frrscript.c
index ccb790dc4a..4fee79991a 100644
--- a/lib/frrscript.c
+++ b/lib/frrscript.c
@@ -103,6 +103,10 @@ char *frrscript_names_get_script_name(const char *function_name)
frrscript_names_find(&frrscript_names_hash, &lookup);
if (!snhe)
return NULL;
+
+ if (snhe->script_name[0] == '\0')
+ return NULL;
+
return snhe->script_name;
}