resource: system: Fix possible vulnerability 57/288557/1 accepted/tizen_7.0_unified tizen_7.0 accepted/tizen/7.0/unified/20230222.081603
authorDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 20 Feb 2023 02:34:02 +0000 (11:34 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Mon, 20 Feb 2023 03:16:04 +0000 (12:16 +0900)
Change-Id: Ic6c261ea13e1a85086a15376ad360deb05f5d6cd
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/resource/resource-system.c

index b9f6fec..dcef99a 100644 (file)
@@ -287,7 +287,7 @@ system_handle_psi_listener(int resource_id,
 
        /* If event occurs in debounce time, lower level event is ignored. */
        gettimeofday(&current, NULL);
-       current_msec = current.tv_sec * 1000 + current.tv_usec / 1000;
+       current_msec = (u_int64_t)current.tv_sec * 1000 + current.tv_usec / 1000;
        if (current_msec - sysdata->memory_pressure_last_update < PSI_EVENT_DEBOUNCE_TIME
            && memory_pressure_level <= sysdata->memory_pressure_level)
                return;