Fix Coverity reported bugs 40/280940/2 accepted/tizen/unified/20220908.124842
authorUnsung Lee <unsung.lee@samsung.com>
Wed, 7 Sep 2022 03:00:23 +0000 (12:00 +0900)
committerUnsung Lee <unsung.lee@samsung.com>
Wed, 7 Sep 2022 05:38:03 +0000 (14:38 +0900)
Change-Id: I18665f0d2e66ef94a05fc055d35c0cce8876d1ec
Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/resource-optimizer/cpu/cpu-boosting.c

index fa6ec8d..859986d 100644 (file)
@@ -389,7 +389,8 @@ static int cpu_boosting_enqueue_by_socket(int sock, struct cpu_boosting_input **
                         input->client_input.command == CPU_BOOSTING_COMMAND_CLEAR_INHERITANCE) {
                char *dest;
 
-               if (input->client_input.dest_len <= 0) {
+               if (input->client_input.dest_len <= 0 ||
+                       input->client_input.dest_len >= MAX_PATH_LENGTH) {
                        _E("[CPU-BOOSTING] Wrong destination name");
                        ret = RESOURCED_ERROR_FAIL;
                        goto destroy_input;