ext2: Fix bug where tokens were not appended a 0 terminator when examining path

This commit is contained in:
mintsuki 2020-11-14 00:59:28 +01:00
parent 352f74daef
commit 754f1a35b7
3 changed files with 4 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@ -214,13 +214,15 @@ static int ext2_parse_dirent(struct ext2_dir_entry *dir, struct ext2_file_handle
struct ext2_inode current_inode = fd->root_inode;
bool escape = false;
char token[256] = {0};
size_t i;
next:
for (size_t i = 0; *path != '/' && *path != '\0'; i++, path++)
for (i = 0; i < 255 && *path != '/' && *path != '\0'; i++, path++)
token[i] = *path;
token[i] = 0;
if (*path == '\0')
escape = true;
else