summaryrefslogtreecommitdiffstats
path: root/common/state
diff options
context:
space:
mode:
Diffstat (limited to 'common/state')
-rw-r--r--common/state/backend_bucket_circular.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/state/backend_bucket_circular.c b/common/state/backend_bucket_circular.c
index 7c81cdfaff..3dcff5cf06 100644
--- a/common/state/backend_bucket_circular.c
+++ b/common/state/backend_bucket_circular.c
@@ -279,7 +279,10 @@ static int state_backend_bucket_circular_read(struct state_backend_storage_bucke
}
*buf_out = buf;
- *len_out = read_len - sizeof(struct state_backend_storage_bucket_circular_meta);
+ /* When reading old state there is no circular bucket metadata */
+ if (circ->last_written_length)
+ read_len -= sizeof(struct state_backend_storage_bucket_circular_meta);
+ *len_out = read_len;
return ret;
}