aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctl-lib/ctl-lua.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c
index f487ed4..33b797b 100644
--- a/ctl-lib/ctl-lua.c
+++ b/ctl-lib/ctl-lua.c
@@ -1281,9 +1281,11 @@ PUBLIC int LuaConfigExec (AFB_ApiT apiHandle, const char* prefix) {
// search for default policy config files
char fullprefix[CONTROL_MAXPATH_LEN];
- strncpy (fullprefix, prefix, strlen(prefix)+1);
- strncat (fullprefix, "-", strlen("-"));
- strncat (fullprefix, GetBinderName(), strlen(GetBinderName()));
+ if(prefix)
+ strncpy (fullprefix, prefix, strlen(prefix)+1);
+ else
+ strncat (fullprefix, GetBinderName(), strlen(GetBinderName()));
+
strncat (fullprefix, "-", strlen("-"));
const char *dirList= getenv("CONTROL_LUA_PATH");