]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
NFSD: pass null terminated buf to kstrtouint()
authorMalahal Naineni <malahal@us.ibm.com>
Sun, 9 Sep 2012 15:25:47 +0000 (10:25 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Oct 2012 16:32:38 +0000 (09:32 -0700)
commit 9959ba0c241a71c7ed8133401cfbbee2720da0b5 upstream.

The 'buf' is prepared with null termination with intention of using it for
this purpose, but 'name' is passed instead!

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/nfs4idmap.c

index fdc91a6fc9c4e3d50bea67386c463bd50d8c4c12..ccfe0d0e7228f8d892c52c039d1134626eeacc7c 100644 (file)
@@ -598,7 +598,7 @@ numeric_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namel
        /* Just to make sure it's null-terminated: */
        memcpy(buf, name, namelen);
        buf[namelen] = '\0';
-       ret = kstrtouint(name, 10, id);
+       ret = kstrtouint(buf, 10, id);
        return ret == 0;
 }