dim/backport-Fix-potential-integer-overflow.patch
jinlun aec8f0106e backport some patches
(cherry picked from commit 6559117500303659f7a061847662458d4037a7da)
2024-04-17 14:20:30 +08:00

26 lines
782 B
Diff

From f298f9aaef28f5846b746e1c9596ad9d8c85b155 Mon Sep 17 00:00:00 2001
From: Huaxin Lu <luhuaxin1@huawei.com>
Date: Mon, 19 Feb 2024 10:01:41 +0800
Subject: [PATCH 19/26] Fix potential integer overflow
---
src/core/tasks/dim_core_measure_kernel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/tasks/dim_core_measure_kernel.c b/src/core/tasks/dim_core_measure_kernel.c
index d49095b..077f30a 100644
--- a/src/core/tasks/dim_core_measure_kernel.c
+++ b/src/core/tasks/dim_core_measure_kernel.c
@@ -21,7 +21,7 @@
static int code_cmp(const void *a, const void *b)
{
- return *(unsigned long *)a - *(unsigned long *)b;
+ return *(unsigned long *)a > *(unsigned long *)b ? 1 : 0;
}
static int sort_jump_table(struct jump_entry *sjump,
--
2.33.0