From 03f498a5ed4bfaa8f2b399f590a5ac08f81b4026 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 15 Feb 2021 20:17:05 +1100 Subject: [PATCH] Fix potential race condition on checksum.len --- rzip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rzip.c b/rzip.c index 732d498..526d02e 100644 --- a/rzip.c +++ b/rzip.c @@ -718,8 +718,8 @@ static inline void hash_search(rzip_control *control, struct rzip_state *st, failure("Failed to malloc ckbuf in hash_search\n"); control->do_mcpy(control, control->checksum.buf, cksum_limit, control->checksum.len); control->checksum.cksum = &st->cksum; - cksum_update(control); cksum_limit += control->checksum.len; + cksum_update(control); } }