mirror of https://github.com/MidnightCommander/mc
Ticket #1527: heap corruption detected on large filenames
Fix bug, introduced in 27fbf91c28
commit. Really allocate 'dirent + NAME_MAX + 1', instead of
sizeof(void*) + NAME_MAX + 1.
Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
This commit is contained in:
parent
3b37c6cd4e
commit
5f1ad860b7
|
@ -789,7 +789,7 @@ mc_readdir (DIR *dirp)
|
|||
* structures, holding dirent size. But we don't use it in libc infrastructure.
|
||||
* TODO: to make simpler homemade dirent-alike structure.
|
||||
*/
|
||||
mc_readdir_result = (struct dirent *)malloc(sizeof(struct dirent *) + NAME_MAX + 1);
|
||||
mc_readdir_result = (struct dirent *)malloc(sizeof(struct dirent) + NAME_MAX + 1);
|
||||
}
|
||||
|
||||
if (!dirp) {
|
||||
|
|
Loading…
Reference in New Issue