Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux...
[linux-drm-fsl-dcu.git] / fs / exportfs / expfs.c
index 293bc2e47a735807a75eaad424764315172367b6..a235f0016889b557e06d6273f0f3dca7d873a608 100644 (file)
@@ -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;