]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commit
resize2fs: Fix fix uninit group test accessing invalid memory
authorTheodore Ts'o <tytso@mit.edu>
Sat, 6 Feb 2010 03:25:03 +0000 (22:25 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 6 Feb 2010 03:50:19 +0000 (22:50 -0500)
commit4828bbe9e7380da0d9153109ab290e88b5d53bf5
tree3d030653a9f2b61246e38062dcb96d4c66002a36
parent4e79a19fe0b6dc3c2bd9cae9dfdbc5e96a3f98f8
resize2fs: Fix fix uninit group test accessing invalid memory

Commit 74128f8 added tests for uninit groups, but it could access past
the end of the group_desc[] array after processing the last group:

==19668== Invalid read of size 2
==19668==    at 0x40518C: resize_fs (resize2fs.c:1824)
==19668==    by 0x405A46: main (main.c:451)
==19668==  Address 0x5a0d002 is not stack'd, malloc'd or (recently) free'd
==19668==
==19668== Invalid read of size 2
==19668==    at 0x405391: resize_fs (resize2fs.c:1864)
==19668==    by 0x405A46: main (main.c:451)
==19668==  Address 0x5a0d002 is not stack'd, malloc'd or (recently) free'd
==19668==

It was found by Eric Sandeen running the regression suite through
valgrind.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
resize/resize2fs.c