Fix crash when processing a corrupted journalfile (#21794)
Fix incorrect calculation of `max_size` in journal transaction replay logic
Stelios Fragkakis committed
Feb 21, 2026 at 18:27 UTC
ee4fd63af28615cdfdb21b8a98bbf9cf9bfa16d4
1 file changed
+1
-1
src/database/engine/journalfile.c
+1
-1
@@ -831,7 +831,7 @@ static uint64_t journalfile_iterate_transactions(struct rrdengine_instance *ctx,
831
for (pos_i = 0; pos_i < size_bytes;) {
832
unsigned max_size;
833
834
- max_size = pos + size_bytes - pos_i;
834
+ max_size = size_bytes - pos_i;
835
ret = journalfile_replay_transaction(ctx, journalfile, buf + pos_i, &id, max_size);
836
if (!ret)
837
/* unknown transaction size, move on to the next block */