Skip to content

Commit d8d17d2

Browse files
author
Michael Tokarev
committed
Revert "vvfat: fix ubsan issue in create_long_filename"
This reverts commit 0cb3ff7. The original code was right in that long name in LFN directory entry uses other parts of the entry for the name too, not just the original "name" field. So it is wrong to limit the offset to be within the name field. Some other mechanism is needed to fix the ubsan report and whole messy usage of bytes past the given field. Reported-by: Volker Rümelin <[email protected]> Signed-off-by: Michael Tokarev <[email protected]>
1 parent 7c89e22 commit d8d17d2

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

block/vvfat.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,10 +426,6 @@ static direntry_t *create_long_filename(BDRVVVFATState *s, const char *filename)
426426
else if(offset<22) offset=14+offset-10;
427427
else offset=28+offset-22;
428428
entry=array_get(&(s->directory),s->directory.next-1-(i/26));
429-
/* ensure we don't write anything past entry->name */
430-
if (offset >= sizeof(entry->name)) {
431-
continue;
432-
}
433429
if (i >= 2 * length + 2) {
434430
entry->name[offset] = 0xff;
435431
} else if (i % 2 == 0) {

0 commit comments

Comments
 (0)