]> git.ipfire.org Git - thirdparty/libarchive.git/commit
Fix EOF handling of __archive_read_ahead (#2196)
authorTobias Stoeckmann <stoeckmann@users.noreply.github.com>
Sun, 2 Jun 2024 23:35:41 +0000 (01:35 +0200)
committerGitHub <noreply@github.com>
Sun, 2 Jun 2024 23:35:41 +0000 (16:35 -0700)
commit1aafde5923a5991dce13a042a0921f16ff648b1a
tree6f87fbec9ab4c691602af670c158c93bf77ec9ec
parent3af83ee6e7f513aa1aa3eec1998fc3c65b5131f5
Fix EOF handling of __archive_read_ahead (#2196)

Reaching EOF for first time sets the correct amount of available bytes,
but each subsequent call returns 0.

Do not forget that the copy buffer can already contain data and return
the amount of bytes left in there.

See added test case.
Makefile.am
libarchive/archive_private.h
libarchive/archive_read.c
libarchive/test/CMakeLists.txt
libarchive/test/test_archive_read.c [new file with mode: 0644]