summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-06-08 01:05:43 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2013-06-08 01:05:43 +0200
commite4327859341f2d3a93b4b6fef2ea483eac1c270c (patch)
treea4a31edd604f580e1513f919e1abbb2507bec6ab /fs
parentMerge tag 'sound-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai... (diff)
parentcifs: fix off-by-one bug in build_unc_path_to_root (diff)
downloadlinux-e4327859341f2d3a93b4b6fef2ea483eac1c270c.tar.xz
linux-e4327859341f2d3a93b4b6fef2ea483eac1c270c.zip
Merge branch 'for-3.10' of git://git.samba.org/sfrench/cifs-2.6
Pull CIFS fix from Steve French: "Fix one byte buffer overrun with prefixpaths on cifs mounts which can cause a problem with mount depending on the string length" * 'for-3.10' of git://git.samba.org/sfrench/cifs-2.6: cifs: fix off-by-one bug in build_unc_path_to_root
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/connect.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 5b97e56ddbca..e3bc39bb9d12 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3279,8 +3279,8 @@ build_unc_path_to_root(const struct smb_vol *vol,
pos = full_path + unc_len;
if (pplen) {
- *pos++ = CIFS_DIR_SEP(cifs_sb);
- strncpy(pos, vol->prepath, pplen);
+ *pos = CIFS_DIR_SEP(cifs_sb);
+ strncpy(pos + 1, vol->prepath, pplen);
pos += pplen;
}