You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
while ((pos_in_buf < buf_size) && (idx_ < index_.size())) {
can terminate prematurely when dealing with a zero-length object. Specifically: for a zero-length object at the end of the buffer, pos_in_buf will equal buf_size and so the loop will terminate, but idx_ will not equal index.size() and so the method ends up erroneously returning kStateContinue.
Zero-length objects can occur only when using uncompressed objects, since a compressed object will never have a zero-length compressed representation. The following integration test case triggers the issue:
cvmfs_test_name="Uncompressed files via gateway"
cvmfs_test_autofs_on_startup=false
cvmfs_test_suites="quick"verify_compression() {
local filename=$1local expected=$2local actual=$(attr -qg compression ${filename})if [ "${actual}"!="${expected}" ] ;thenecho"Compression mismatch for ${filename}: expected ${expected} actual ${actual}"return 101
fi
}
cvmfs_run_test() {
local reponame=test.repo.org
local repodir=/cvmfs/${reponame}echo"set up gateway"
set_up_repository_gateway ||return 1
echo"parse configuration"
load_repo_config ${reponame}local spooldir=${CVMFS_SPOOL_DIR}echo"start transaction"
cvmfs_server transaction ${reponame}||return 11
echo"create test files"echo"Hello world!">${repodir}/file1
touch ${repodir}/file2
echo"publish (uncompressed) and check"
cvmfs_server publish -Z none ${reponame}||return 12
cvmfs_server check -i ${reponame}||return 13
echo"verify files"
[ -f${repodir}/file1 -a-s${repodir}/file1 ] ||return 14
[ -f${repodir}/file2 -a!-s${repodir}/file2 ] ||return 15
verify_compression ${spooldir}/rdonly/file1 none ||return$?
verify_compression ${spooldir}/rdonly/file2 none ||return$?
}
The text was updated successfully, but these errors were encountered:
The processing loop in
ObjectPackConsumer::ConsumePayload()
:cvmfs/cvmfs/pack.cc
Lines 338 to 341 in f6095b5
can terminate prematurely when dealing with a zero-length object. Specifically: for a zero-length object at the end of the buffer,
pos_in_buf
will equalbuf_size
and so the loop will terminate, butidx_
will not equalindex.size()
and so the method ends up erroneously returningkStateContinue
.Zero-length objects can occur only when using uncompressed objects, since a compressed object will never have a zero-length compressed representation. The following integration test case triggers the issue:
The text was updated successfully, but these errors were encountered: