]> git.ipfire.org Git - thirdparty/git.git/commit - pack-bitmap.c
ewah: adjust callers of ewah_read_mmap()
authorJeff King <peff@peff.net>
Fri, 15 Jun 2018 03:44:43 +0000 (23:44 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 18 Jun 2018 16:13:57 +0000 (09:13 -0700)
commit1140bf01ecf4a49c32b3c385dd782cd183e730af
tree9253363dc076c4cf88cc60b93d1706fd38f3f0c5
parent9d2e330b1795222c2c816afa46138e7ff4ebec8e
ewah: adjust callers of ewah_read_mmap()

The return value of ewah_read_mmap() is now an ssize_t,
since we could (in theory) process up to 32GB of data. This
would never happen in practice, but a corrupt or malicious
.bitmap or index file could convince us to do so.

Let's make sure that we don't stuff the value into an int,
which would cause us to incorrectly move our pointer
forward.  We'd always move too little, since negative values
are used for reporting errors. So the worst case is just
that we end up reporting a corrupt file, not an
out-of-bounds read.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c
pack-bitmap.c