From: Dan Carpenter Date: Tue, 13 Jul 2010 11:34:59 +0000 (+0200) Subject: nfs: include space for the NUL in root path X-Git-Tag: v2.6.35~3^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=674b2222920012244ca59978b356b25412a8dcc7;p=pandora-kernel.git nfs: include space for the NUL in root path In root_nfs_name() it does the following: if (strlen(buf) + strlen(cp) > NFS_MAXPATHLEN) { printk(KERN_ERR "Root-NFS: Pathname for remote directory too long.\n"); return -1; } sprintf(nfs_export_path, buf, cp); In the original code if (strlen(buf) + strlen(cp) == NFS_MAXPATHLEN) then the sprintf() would lead to an overflow. Generally the rest of the code assumes that the path can have NFS_MAXPATHLEN (1024) characters and a NUL terminator so the fix is to add space to the nfs_export_path[] buffer. Signed-off-by: Dan Carpenter Signed-off-by: Trond Myklebust --- Reading git-diff-tree failed