aports/testing/yyjson/false-error-about-uninitialized-variable.patch
2023-06-05 11:37:08 +02:00

12 lines
510 B
Diff

--- a/src/yyjson.c
+++ b/src/yyjson.c
@@ -1773,7 +1773,7 @@
static_inline yyjson_val *ptr_arr_get(yyjson_val *arr, const char *token,
usize len, usize esc) {
yyjson_val *val = unsafe_yyjson_get_first(arr);
- usize num = unsafe_yyjson_get_len(arr), idx;
+ usize num = unsafe_yyjson_get_len(arr), idx = 0;
if (unlikely(num == 0)) return NULL;
if (unlikely(!ptr_token_to_idx(token, len, &idx))) return NULL;
if (unlikely(idx >= num)) return NULL;