diff options
author | Jihoon Kim <jihoon48.kim@samsung.com> | 2023-03-10 13:35:28 +0900 |
---|---|---|
committer | Jihoon Kim <jihoon48.kim@samsung.com> | 2023-12-22 08:46:50 +0900 |
commit | efb93c3632c1671a098293c8c79cd21f9fe7a985 (patch) | |
tree | 6bd89afb1084d4a8676a73aae945fbba5e71c312 | |
parent | 243b0c8703e4339454d7b8e6758ffe6daddbb263 (diff) | |
download | libxkbcommon-efb93c3632c1671a098293c8c79cd21f9fe7a985.tar.gz libxkbcommon-efb93c3632c1671a098293c8c79cd21f9fe7a985.tar.bz2 libxkbcommon-efb93c3632c1671a098293c8c79cd21f9fe7a985.zip |
Fix NULL after deref issue detected by static analysis tool
Change-Id: Ib63eaf8969c1fb75e02683908b276d2fc1d13705
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
-rw-r--r-- | src/xkbcomp/compat.c | 3 | ||||
-rw-r--r-- | src/xkbcomp/keycodes.c | 3 | ||||
-rw-r--r-- | src/xkbcomp/symbols.c | 3 | ||||
-rw-r--r-- | src/xkbcomp/types.c | 3 |
4 files changed, 12 insertions, 0 deletions
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c index 9b6f9de..44a444c 100644 --- a/src/xkbcomp/compat.c +++ b/src/xkbcomp/compat.c @@ -430,6 +430,9 @@ HandleIncludeCompatMap(CompatInfo *info, IncludeStmt *include) { CompatInfo included; + if (!include) + return false; + InitCompatInfo(&included, info->ctx, info->actions, &info->mods); included.name = include->stmt; include->stmt = NULL; diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c index 91471ea..0655447 100644 --- a/src/xkbcomp/keycodes.c +++ b/src/xkbcomp/keycodes.c @@ -339,6 +339,9 @@ HandleIncludeKeycodes(KeyNamesInfo *info, IncludeStmt *include) { KeyNamesInfo included; + if (!include) + return false; + InitKeyNamesInfo(&included, info->ctx); included.name = include->stmt; include->stmt = NULL; diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index 6d46884..58f73e6 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -569,6 +569,9 @@ HandleIncludeSymbols(SymbolsInfo *info, IncludeStmt *include) { SymbolsInfo included; + if (!include) + return false; + InitSymbolsInfo(&included, info->keymap, info->actions, &info->mods); included.name = include->stmt; include->stmt = NULL; diff --git a/src/xkbcomp/types.c b/src/xkbcomp/types.c index 34e1028..fa12c23 100644 --- a/src/xkbcomp/types.c +++ b/src/xkbcomp/types.c @@ -212,6 +212,9 @@ HandleIncludeKeyTypes(KeyTypesInfo *info, IncludeStmt *include) { KeyTypesInfo included; + if (!include) + return false; + InitKeyTypesInfo(&included, info->ctx, &info->mods); included.name = include->stmt; include->stmt = NULL; |