diff --git a/osquery/filesystem/file_compression.cpp b/osquery/filesystem/file_compression.cpp index 780bc714dc7..8eabb5ec2a9 100644 --- a/osquery/filesystem/file_compression.cpp +++ b/osquery/filesystem/file_compression.cpp @@ -187,9 +187,9 @@ Status archive(const std::set& paths, for (size_t i = 0; i < blkCount; i++) { std::vector block(block_size, 0); auto r = pFile.read(block.data(), block_size); - if (r != block_size && r > 0) { + if (r > 0 && static_cast(r) != block_size) { // resize the buffer to size we read as last block is likely smaller - block.resize(r); + block.resize(static_cast(r)); } archive_write_data(arch, block.data(), block.size()); }