mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
linux(4): Properly allocate buffer for kern_getdirentries in readdir
Looks like prior to ino64 project the size of the struct linux_dirent was greater (or equal) to the size of the native struct dirent so the native dirent fit into the buffer. After ino64 project the size of the native struct dirent has increased. Spotted by gcc12. MFC after: 2 weeks
This commit is contained in:
parent
9efad6f9e1
commit
fc1c787aa0
1 changed files with 1 additions and 1 deletions
|
|
@ -560,7 +560,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args)
|
|||
struct l_dirent *linux_dirent;
|
||||
int buflen, error;
|
||||
|
||||
buflen = LINUX_RECLEN(LINUX_NAME_MAX);
|
||||
buflen = sizeof(*bdp);
|
||||
buf = malloc(buflen, M_TEMP, M_WAITOK);
|
||||
|
||||
error = kern_getdirentries(td, args->fd, buf, buflen,
|
||||
|
|
|
|||
Loading…
Reference in a new issue