Skip to content

Commit dfc59e2

Browse files
author
Al Viro
committed
exportfs: don't assume that ->iterate() won't feed us too long entries
On some filesystems it's impossible even with fs corruption, but we'd better not rely on that, what with memcpy() into on-stack array we are doing there. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 5d8943b commit dfc59e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/exportfs/expfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static int filldir_one(void * __buf, const char * name, int len,
231231
int result = 0;
232232

233233
buf->sequence++;
234-
if (buf->ino == ino) {
234+
if (buf->ino == ino && len <= NAME_MAX) {
235235
memcpy(buf->name, name, len);
236236
buf->name[len] = '\0';
237237
buf->found = 1;

0 commit comments

Comments
 (0)