mirror of
https://github.com/ckolivas/lrzip.git
synced 2025-12-31 22:00:14 +01:00
Check seek hasn't made the pseudo file longer.
This commit is contained in:
parent
19ef7298c8
commit
7eabb5e7de
4
runzip.c
4
runzip.c
|
|
@ -85,6 +85,8 @@ static i64 seekto_fdout(rzip_control *control, i64 pos)
|
|||
if (!TMP_OUTBUF)
|
||||
return lseek(control->fd_out, pos, SEEK_SET);
|
||||
control->out_ofs = pos - control->rel_ofs;
|
||||
if (control->out_ofs > control->out_len)
|
||||
control->out_len = control->out_ofs;
|
||||
if (unlikely(control->out_ofs < 0 || control->out_ofs > control->out_maxlen)) {
|
||||
print_err("Trying to seek outside tmpoutbuf in seekto_fdout\n");
|
||||
return -1;
|
||||
|
|
@ -97,6 +99,8 @@ static i64 seekto_fdhist(rzip_control *control, i64 pos)
|
|||
if (!TMP_OUTBUF)
|
||||
return lseek(control->fd_hist, pos, SEEK_SET);
|
||||
control->hist_ofs = pos - control->rel_ofs;
|
||||
if (control->hist_ofs > control->out_len)
|
||||
control->out_len = control->hist_ofs;
|
||||
if (unlikely(control->hist_ofs < 0 || control->hist_ofs > control->out_maxlen)) {
|
||||
print_err("Trying to seek outside tmpoutbuf in seekto_fdhist\n");
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue