hal-api: common: Check value validation for current platform HAL ABI version 95/274095/3 accepted/tizen/unified/20220422.133442 submit/tizen/20220421.230800
authorChanwoo Choi <cw00.choi@samsung.com>
Thu, 21 Apr 2022 08:01:07 +0000 (17:01 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 21 Apr 2022 08:53:06 +0000 (17:53 +0900)
Change-Id: I0b6cf1627f992acc47532553b3588342f58990b6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/hal-api-common.c

index db73891..8273b72 100644 (file)
@@ -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];