From be14d7d76c078c7d755291266851cdc6edbd2e6d Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 16 May 2018 11:44:24 +0200 Subject: Fix: arguments pointer NULL check Change-Id: I666136b1f1fb21d223fa16f299de2ce5430a0c7e Signed-off-by: Romain Forlot --- ctl-lib/ctl-action.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ctl-lib/ctl-action.c b/ctl-lib/ctl-action.c index ce9b2b8..e7c3361 100644 --- a/ctl-lib/ctl-action.c +++ b/ctl-lib/ctl-action.c @@ -27,9 +27,12 @@ #include "ctl-config.h" int ActionLabelToIndex(CtlActionT*actions, const char* actionLabel) { - for (int idx = 0; actions[idx].uid; idx++) { - if (!strcasecmp(actionLabel, actions[idx].uid)) return idx; + if (actions) { + for (int idx = 0; actions[idx].uid; idx++) { + if (!strcasecmp(actionLabel, actions[idx].uid)) return idx; + } } + return -1; } -- cgit 1.2.3-korg