libgit2/libgit2 — pull request #1626 by ethomson (2013-05-31 16:45:49+00:00)
Title: improve test for index extension truncation

Both `buffer_size` and `total_size` are unsigned and we currently compare `buffer_size` (the length of the remaining buffer) to `total_size` (the size that we need to consume from the index to fill in this extension - the advertised length plus the length of the extension header) but when `buffer_size < total_size`, it will very rarely be true that `buffer_size - total_size < INDEX_FOOTER_SIZE`. We should instead test that explicitly.