Skip to content
Snippets Groups Projects
Commit d1bdf224 authored by Stefan Brüns's avatar Stefan Brüns Committed by Tom Rini
Browse files

ext4: Fix handling of direntlen in unlink_filename


The direntlen checks were quite bogus, i.e. the loop termination used
"len + offset == blocksize" (exact match only), and checked for a
direntlen less than 0. The latter can never happen as the len is
unsigned, this has been reported by Coverity, CID 153384.

Use the same code as in search_dir for directory traversal. This code
has the correct checks for direntlen >= sizeof(struct dirent), and
offset < blocksize.

Signed-off-by: default avatarStefan Brüns <stefan.bruens@rwth-aachen.de>
Reported-by: Coverity (CID: 153383, 153384)
Reviewed-by: default avatarTom Rini <trini@konsulko.com>
Reviewed-by: default avatarLukasz Majewski <l.majewski@samsung.com>
parent 15bf8c4f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment