mirror of
https://github.com/ckolivas/lrzip.git
synced 2026-01-05 08:00:05 +01:00
checksum.buf should only be changed after the semaphore wait
This commit is contained in:
parent
a2796607d9
commit
d05334bd86
4
main.c
4
main.c
|
|
@ -578,8 +578,8 @@ int main(int argc, char *argv[])
|
|||
recursion:
|
||||
if (recurse) {
|
||||
if (curentry >= direntries) {
|
||||
free(dirlist);
|
||||
break;
|
||||
infile = NULL;
|
||||
continue;
|
||||
}
|
||||
infile = dirlist + MAX_PATH_LEN * curentry++;
|
||||
}
|
||||
|
|
|
|||
2
rzip.c
2
rzip.c
|
|
@ -744,11 +744,11 @@ static inline void hash_search(rzip_control *control, struct rzip_state *st,
|
|||
if (cksum_len < control->page_size)
|
||||
failure("Failed to malloc any ram for checksum ckbuf\n");
|
||||
}
|
||||
control->checksum.buf = buf;
|
||||
|
||||
/* Compute checksum. If the entire chunk is longer than maxram,
|
||||
* do it "per-partes" */
|
||||
cksem_wait(control, &control->cksumsem);
|
||||
control->checksum.buf = buf;
|
||||
control->checksum.len = st->chunk_size - cksum_limit;
|
||||
cksum_chunks = control->checksum.len / cksum_len;
|
||||
cksum_remains = control->checksum.len % cksum_len;
|
||||
|
|
|
|||
Loading…
Reference in a new issue