Skip to content

Commit

Permalink
NFSD: pass null terminated buf to kstrtouint()
Browse files Browse the repository at this point in the history
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>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
Malahal Naineni authored and J. Bruce Fields committed Sep 10, 2012
1 parent 8c8651b commit 9959ba0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4idmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9959ba0

Please sign in to comment.