gazelle/0101-fix-func-separate_str_to_array-overflow-problem.patch

27 lines
920 B
Diff
Raw Normal View History

From 58248cb2bae3d2c50f65b3ade360fc14716a0ce7 Mon Sep 17 00:00:00 2001
From: yinbin6 <yinbin8@huawei.com>
Date: Mon, 25 Dec 2023 11:06:18 +0000
Subject: [PATCH] fix func separate_str_to_array overflow problem
Signed-off-by: yinbin6 <yinbin8@huawei.com>
---
src/common/gazelle_parse_config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/common/gazelle_parse_config.c b/src/common/gazelle_parse_config.c
index 9772af9..16efdc8 100644
--- a/src/common/gazelle_parse_config.c
+++ b/src/common/gazelle_parse_config.c
@@ -78,7 +78,7 @@ int32_t separate_str_to_array(char *args, uint32_t *array, int32_t array_size, i
min = idx;
}
for (idx = min; idx <= max; idx++) {
- if (count > array_size) {
+ if (count >= array_size) {
return -1;
}
array[count] = idx;
--
2.27.0