Commit dfc59e2c authored by Al Viro's avatar Al Viro

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 5d8943b0
...@@ -231,7 +231,7 @@ static int filldir_one(void * __buf, const char * name, int len, ...@@ -231,7 +231,7 @@ static int filldir_one(void * __buf, const char * name, int len,
int result = 0; int result = 0;
buf->sequence++; buf->sequence++;
if (buf->ino == ino) { if (buf->ino == ino && len <= NAME_MAX) {
memcpy(buf->name, name, len); memcpy(buf->name, name, len);
buf->name[len] = '\0'; buf->name[len] = '\0';
buf->found = 1; buf->found = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment