* Also have the uppper limit check in the assert.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32323 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
7712cf43c3
commit
368fc35adf
@ -5561,9 +5561,11 @@ fix_dirent(struct vnode* parent, struct dirent* userEntry,
|
||||
if (user_memcpy(entry, userEntry, sizeof(struct dirent) - 1) != B_OK)
|
||||
return B_BAD_ADDRESS;
|
||||
|
||||
ASSERT(entry->d_reclen >= sizeof(struct dirent));
|
||||
ASSERT(entry->d_reclen >= sizeof(struct dirent)
|
||||
&& entry->d_reclen <= sizeof(buffer));
|
||||
|
||||
// This hints to a problem in the file system implementation
|
||||
// This hints to a problem in the file system implementation, but
|
||||
// could also be caused by a malicious user application
|
||||
if (entry->d_reclen < sizeof(struct dirent)
|
||||
|| entry->d_reclen > sizeof(buffer))
|
||||
return B_BAD_DATA;
|
||||
|
Loading…
x
Reference in New Issue
Block a user