From 6a021caf4d70242b6430fa30262f8151e1408735 Mon Sep 17 00:00:00 2001 From: Chanwoo Choi Date: Thu, 21 Apr 2022 17:01:07 +0900 Subject: [PATCH] hal-api: common: Check value validation for current platform HAL ABI version Change-Id: I0b6cf1627f992acc47532553b3588342f58990b6 Signed-off-by: Chanwoo Choi --- src/hal-api-common.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/hal-api-common.c b/src/hal-api-common.c index db73891..8273b72 100644 --- a/src/hal-api-common.c +++ b/src/hal-api-common.c @@ -537,6 +537,15 @@ int hal_common_check_backend_abi_version(enum hal_module module, } g_platform_curr_abi_version = _hal_api_conf_get_platform_abi_version(); + + if (g_platform_curr_abi_version <= HAL_ABI_VERSION_UNKNOWN + || g_platform_curr_abi_version >= HAL_ABI_VERSION_END) { + _E("Invalid paramer of current HAL ABI version(%d)(%d)\n", + g_platform_curr_abi_version, module); + ret = -EINVAL; + goto out; + } + for (i = 0; i < info->num_abi_versions; i++) { struct hal_abi_version_match *data = &info->abi_versions[i]; -- 2.7.4