From: Jihoon Kim Date: Mon, 13 Mar 2023 06:13:03 +0000 (+0900) Subject: Fix dereference after NULL issue X-Git-Tag: accepted/tizen/unified/20230316.101436^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fba09b8a9145552a9702df89f0878f08aea4498f;p=platform%2Fupstream%2Flibxkbcommon.git Fix dereference after NULL issue After having been compared to a NULL value at symbols.c 763, pointer 'act' is passed as 4th parameter in call to function 'HandleActionDef' at symbols.c 775, where it is dereferenced at action.c 788. Change-Id: Ib25edc48b26d523fa11a5e99d171750bd768b14d Signed-off-by: Jihoon Kim --- diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index 70d3198..53561ad 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -775,13 +775,15 @@ AddActionsToKey(SymbolsInfo *info, KeyInfo *keyi, ExprDef *arrayNdx, for (unsigned i = 0; i < nActs; i++) { union xkb_action *toAct = &darray_item(groupi->levels, i).action; - if (!HandleActionDef(info->ctx, info->actions, &info->mods, act, toAct)) - log_err(info->ctx, - "Illegal action definition for %s; " - "Action for group %u/level %u ignored\n", - KeyInfoText(info, keyi), ndx + 1, i + 1); + if (act) { + if (!HandleActionDef(info->ctx, info->actions, &info->mods, act, toAct)) + log_err(info->ctx, + "Illegal action definition for %s; " + "Action for group %u/level %u ignored\n", + KeyInfoText(info, keyi), ndx + 1, i + 1); - act = (ExprDef *) act->common.next; + act = (ExprDef *) act->common.next; + } } return true;