commit 5de2cdf30418dcdea5a0d246bf17b86f00e3a81e
parent 221c7acf396077e3f3f86ea6dd1d503b155c6aba
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Tue, 10 Mar 2026 09:06:54 +0100
Fix the function that hashes a list of lines
The way the size of the data to be hashed was calculated was incorrect
and was actually based on an uninitialized value.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shtr_line_list.c b/src/shtr_line_list.c
@@ -523,7 +523,7 @@ hash_blocks(const struct shtr_line_list* list, struct sha256_ctx* ctx)
n = darray_charp_size_get(&list->blocks);
FOR_EACH(i, 0, n) {
const char* block = darray_charp_cdata_get(&list->blocks)[i];
- const size_t nlines = MMIN(NLINES_PER_BLOCK, nlines - i*NLINES_PER_BLOCK);
+ const size_t nlines = MMIN(NLINES_PER_BLOCK, list->nlines-i*NLINES_PER_BLOCK);
sha256_ctx_update(ctx, block, nlines*sizeof(struct line));
}