Commit 2bb06038 authored by Malahal Naineni's avatar Malahal Naineni Committed by Greg Kroah-Hartman

NFSD: pass null terminated buf to kstrtouint()

commit 9959ba0c upstream.

The 'buf' is prepared with null termination with intention of using it for
this purpose, but 'name' is passed instead!
Signed-off-by: default avatarMalahal Naineni <malahal@us.ibm.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 17170f0b
......@@ -581,7 +581,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;
}
......
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