]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Do not request 0-length skips; sanity-check return. 104/head
authorAlexey Spiridonov <snarkmaster@gmail.com>
Mon, 2 Feb 2015 03:26:26 +0000 (19:26 -0800)
committerAlexey Spiridonov <snarkmaster@gmail.com>
Mon, 2 Feb 2015 06:16:29 +0000 (22:16 -0800)
commitafcc3e49ad6689288245d1540ac8a1d8de27a921
tree8dfc602b67b7c46234278c1b1cf50d31b05fec3e
parente6c9668f3202215ddb71617b41c19b6f05acf008
Do not request 0-length skips; sanity-check return.

I noticed that my skip callback was always being invoked with a request of
0.  This is a bit wasteful since skip callbacks commonly involve a syscall
like lseek().

Also, it seems good to error out when the skip callback is buggy, and claims
to skip more than requested.

Test Plan:

```
autoreconf -ivf && ./configure && make && make check
```

The same tests fail as before, with the same error messages. If interested,
both failure logs are here:

https://github.com/snarkmaster/libarchive/commit/00c9751cde6cc888fb844b7a1fcc0f82dbaaedb1

These are on Ubuntu 14.04.
libarchive/archive_read.c