aboutsummaryrefslogtreecommitdiff
path: root/malloc/alloc_buffer_alloc_array.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <szabolcs.nagy@arm.com>2022-10-11 13:23:25 +0100
committerSzabolcs Nagy <szabolcs.nagy@arm.com>2022-10-27 14:46:48 +0100
commit1dc3098e2c316254d6a9cb50797f2eca9be92b9f (patch)
tree15f6f6a59d21cafce9b9dbb76908056ad147ad8f /malloc/alloc_buffer_alloc_array.c
parent5f1f0f9a718b67c6205dbb90760a0f72385dc205 (diff)
downloadglibc-1dc3098e2c316254d6a9cb50797f2eca9be92b9f.tar.xz
glibc-1dc3098e2c316254d6a9cb50797f2eca9be92b9f.zip
Fix malloc/tst-scratch_buffer OOB access
The test used scratch_buffer_dupfree incorrectly: - The passed in size must be <= buf.length. - Must be called at most once on a buf object since it frees it. - After it is called buf.data and buf.length must not be accessed. All of these were violated, the test happened to work because the buffer was on the stack, which meant the test copied out-of-bounds bytes from the stack into a new buffer and then compared those bytes. Run one test and avoid the issues above.
Diffstat (limited to 'malloc/alloc_buffer_alloc_array.c')
0 files changed, 0 insertions, 0 deletions