diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-07 16:05:43 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-06-07 16:05:43 -0700 |
commit | e4327859341f2d3a93b4b6fef2ea483eac1c270c (patch) | |
tree | a4a31edd604f580e1513f919e1abbb2507bec6ab | |
parent | 308f8813de2b608e8de436fa03a795d2e94f1a1f (diff) | |
parent | 1fc29bacedeabb278080e31bb9c1ecb49f143c3b (diff) |
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
-rw-r--r-- | fs/cifs/connect.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 5b97e56ddbc..e3bc39bb9d1 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; } |