diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2019-11-14 10:24:32 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2019-11-14 10:24:32 +0100 |
commit | 5dea708711fb10b3c02f2d8970a9ebe381feb620 (patch) | |
tree | 373684681ea528b65abfe4efbff573aa64a20d90 | |
parent | aa591bb619531b84d21ba6784d9f111ea8b36882 (diff) |
sig-comp: Fix core dump when adding a signal...icefish_8.99.1icefish/8.99.18.99.1
Fix core dump when adding a signal with a wrong source's api name.
This commit avoids the crash and throw an error through the journal log
of the binding service.
Bug-AGL: SPEC-2956
Change-Id: Idf052df05d76f831f56ec3c565bacf821b9b4e69
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r-- | signal-composer-binding/signal-composer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/signal-composer-binding/signal-composer.cpp b/signal-composer-binding/signal-composer.cpp index 9abe54e..e8e7668 100644 --- a/signal-composer-binding/signal-composer.cpp +++ b/signal-composer-binding/signal-composer.cpp @@ -259,6 +259,11 @@ int Composer::loadOneSignal(afb_api_t apihandle, json_object* signalJ) } std::string api = eventStr.substr(0, sep); src = getSourceAPI(api); + if(!src) + { + AFB_ERROR("Can't find the source API %s for the event %s. Check you configuration.", api.c_str(), eventStr.c_str()); + return -1; + } } else { |