nfsd: don't allow zero length strings in cache_parse()
[pandora-kernel.git] / net / sunrpc / cache.c
index 72ad836..4530a91 100644 (file)
@@ -828,6 +828,8 @@ static ssize_t cache_do_downcall(char *kaddr, const char __user *buf,
 {
        ssize_t ret;
 
+       if (count == 0)
+               return -EINVAL;
        if (copy_from_user(kaddr, buf, count))
                return -EFAULT;
        kaddr[count] = '\0';