]> git.ipfire.org Git - thirdparty/xz.git/commit
Tests: test_index: Make it clear that my_alloc() has no integer overflows
authorLasse Collin <lasse.collin@tukaani.org>
Sat, 27 Apr 2024 11:56:16 +0000 (14:56 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 21 May 2024 21:12:07 +0000 (00:12 +0300)
commit24dd20ca1d8512710daf7a4f4657164a2d8d36de
tree8af46889493fa879eb872cfa6fae39a997f8c9d7
parent189251f5d2150b25b5d8d03f378ed5143c916c4b
Tests: test_index: Make it clear that my_alloc() has no integer overflows

liblzma guarantees that the product of the allocation size arguments
will fit in size_t.

Putting the pre-increment in the if-statement was clearly wrong
although in practice it didn't matter here as the function is
called only a couple of times.

(cherry picked from commit 7f865577a6224fbbb5f5ca52574b62ea8ac9bf51)
tests/test_index.c