mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-02 21:32:58 +00:00
MFC r326391: Prevent OOB access on corrupted msdos directories.
Submitted by: Veo Zhang <veo live com>
This commit is contained in:
parent
953b27c01d
commit
56580f3f6d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/stable/10/; revision=326843
@ -619,7 +619,7 @@ readDosDirSection(int f, struct bootblock *boot, struct fatEntry *fat,
|
||||
dirent.name[8] = '\0';
|
||||
for (k = 7; k >= 0 && dirent.name[k] == ' '; k--)
|
||||
dirent.name[k] = '\0';
|
||||
if (dirent.name[k] != '\0')
|
||||
if (k < 0 || dirent.name[k] != '\0')
|
||||
k++;
|
||||
if (dirent.name[0] == SLOT_E5)
|
||||
dirent.name[0] = 0xe5;
|
||||
|
Loading…
Reference in New Issue
Block a user