Skip to content

Commit

Permalink
exportfs: don't assume that ->iterate() won't feed us too long entries
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Al Viro committed Sep 7, 2013
1 parent 5d8943b commit dfc59e2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/exportfs/expfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ static int filldir_one(void * __buf, const char * name, int len,
int result = 0;

buf->sequence++;
if (buf->ino == ino) {
if (buf->ino == ino && len <= NAME_MAX) {
memcpy(buf->name, name, len);
buf->name[len] = '\0';
buf->found = 1;
Expand Down

0 comments on commit dfc59e2

Please sign in to comment.