mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-03-28 00:42:25 +01:00
23 lines
884 B
Diff
23 lines
884 B
Diff
diff --git a/libpromises/evalfunction.c b/libpromises/evalfunction.c
|
|
index 0dfda1093..870caa221 100644
|
|
--- a/libpromises/evalfunction.c
|
|
+++ b/libpromises/evalfunction.c
|
|
@@ -8060,14 +8060,15 @@ static const char *ClassFilterDataGetClassExprFromIndex(
|
|
JsonElement *json_array,
|
|
const char *class_expr_index)
|
|
{
|
|
- size_t index;
|
|
+ unsigned long index_ulong;
|
|
assert(SIZE_MAX >= ULONG_MAX); /* make sure returned value can fit in size_t */
|
|
- if (StringToUlong(class_expr_index, &index) != 0) {
|
|
+ if (StringToUlong(class_expr_index, &index_ulong) != 0) {
|
|
Log(LOG_LEVEL_VERBOSE,
|
|
"Function %s(): Bad index '%s' to class expression: "
|
|
"Failed to parse integer", fn_name, class_expr_index);
|
|
return NULL;
|
|
}
|
|
+ size_t index = (size_t)index_ulong;
|
|
|
|
size_t length = JsonLength(json_array);
|
|
if (index >= length)
|