]> www.infradead.org Git - users/dwmw2/qemu.git/commit
vvfat: create_long_filename: fix out-of-bounds array access
authorMichael Tokarev <mjt@tls.msk.ru>
Sun, 19 Jan 2025 09:35:47 +0000 (12:35 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Thu, 30 Jan 2025 10:01:22 +0000 (13:01 +0300)
commit6003402aa91053c6884f1cf324692dcc035df96c
tree9372d674d128a8b2050977e57314400af1b011a9
parentc6a1b591a68b4d7230d6c3f56965e18080d737e5
vvfat: create_long_filename: fix out-of-bounds array access

create_long_filename() intentionally uses direntry_t->name[8+3] array
as a larger array.  This works, but makes static code analysis tools
unhappy.  The problem here is that a directory entry holding long file
name is significantly different from regular directory entry, and the
name is split into several parts within the entry, not just in regular
8+3 name field.

Treat the entry as array of bytes instead.  This fixes the OOB access
from the compiler/tools PoV, but does not change the resulting code
in any way.

Keep the existing code style.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
block/vvfat.c