summaryrefslogtreecommitdiffstats
path: root/ctl-lib
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-12-18 14:15:10 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-19 16:36:30 +0100
commit407a93713fd839d4e7dd055d97c0336d628f5de6 (patch)
tree592c14a2a51c5f0ee6357a57074c96976e989419 /ctl-lib
parent351c6ca6d1dc2fa2c532d549bc84cca8837f1bc7 (diff)
Fix segfault when no l2c functions defined
Mark "ldpath" parameter as optional like it is. Change-Id: If32e078f5a4349ab895b1fd4b8f0a8c542d247a1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib')
-rw-r--r--ctl-lib/ctl-action.c2
-rw-r--r--ctl-lib/ctl-plugin.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/ctl-lib/ctl-action.c b/ctl-lib/ctl-action.c
index e4306f9..87ee40f 100644
--- a/ctl-lib/ctl-action.c
+++ b/ctl-lib/ctl-action.c
@@ -58,7 +58,7 @@ PUBLIC void ActionExecUID(AFB_ReqT request, CtlConfigT *ctlConfig, const char *u
PUBLIC void ActionExecOne(CtlSourceT *source, CtlActionT* action, json_object *queryJ) {
int err = 0;
- if(action->type == CTL_TYPE_LUA && ctlLua2cFunc->l2cCount) {
+ if(action->type == CTL_TYPE_LUA && ctlLua2cFunc && ctlLua2cFunc->l2cCount) {
LuaL2cNewLib (ctlLua2cFunc->l2cFunc, ctlLua2cFunc->l2cCount);
}
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c
index 42f9d9e..5677f91 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -100,7 +100,7 @@ STATIC int PluginLoadOne (AFB_ApiT apiHandle, CtlPluginT *ctlPlugin, json_object
"basename", &basename,
"lua2c", &lua2csJ);
if (err) {
- AFB_ApiError(apiHandle, "CTL-PLUGIN-LOADONE Plugin missing uid|[info]|basename|ldpath|[lua2c] in:\n-- %s", json_object_get_string(pluginJ));
+ AFB_ApiError(apiHandle, "CTL-PLUGIN-LOADONE Plugin missing uid|[info]|basename|[ldpath]|[lua2c] in:\n-- %s", json_object_get_string(pluginJ));
goto OnErrorExit;
}