* We also shouldn't try to copy if the dirent is too large, obviously.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32314 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-08-13 14:21:18 +00:00
parent 0f282bc263
commit 48cb56d8ef

View File

@ -5564,7 +5564,8 @@ fix_dirent(struct vnode* parent, struct dirent* userEntry,
ASSERT(entry->d_reclen >= sizeof(struct dirent));
// This hints to a problem in the file system implementation
if (entry->d_reclen < sizeof(struct dirent))
if (entry->d_reclen < sizeof(struct dirent)
|| entry->d_reclen > sizeof(buffer))
return B_BAD_DATA;
if (user_memcpy(entry->d_name, userEntry->d_name,