Fix potential race condition on checksum.len

This commit is contained in:
Con Kolivas 2021-02-15 20:17:05 +11:00
parent eb9e660d56
commit 03f498a5ed

2
rzip.c
View file

@ -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);
}
}