summaryrefslogtreecommitdiff
path: root/fs/cifs/dns_resolve.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-11-30 23:14:48 +0300
committerSteve French <sfrench@us.ibm.com>2010-11-30 23:44:05 +0300
commitba03864872691c0bb580a7fb47388da337ef4aa2 (patch)
tree05584dc9061390fedf5caa749a2f7d728324b232 /fs/cifs/dns_resolve.c
parent476428f8c3bb6679f8f52bf2b935ac40bc9c7358 (diff)
downloadlinux-ba03864872691c0bb580a7fb47388da337ef4aa2.tar.xz
cifs: fix parsing of hostname in dfs referrals
The DFS referral parsing code does a memchr() call to find the '\\' delimiter that separates the hostname in the referral UNC from the sharename. It then uses that value to set the length of the hostname via pointer subtraction. Instead of subtracting the start of the hostname however, it subtracts the start of the UNC, which causes the code to pass in a hostname length that is 2 bytes too long. Regression introduced in commit 1a4240f4. Reported-and-Tested-by: Robbert Kouprie <robbert@exx.nl> Signed-off-by: Jeff Layton <jlayton@redhat.com> Cc: Wang Lei <wang840925@gmail.com> Cc: David Howells <dhowells@redhat.com> Cc: stable@kernel.org Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/dns_resolve.c')
-rw-r--r--fs/cifs/dns_resolve.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c
index 0eb87026cad3..548f06230a6d 100644
--- a/fs/cifs/dns_resolve.c
+++ b/fs/cifs/dns_resolve.c
@@ -66,7 +66,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr)
/* Search for server name delimiter */
sep = memchr(hostname, '\\', len);
if (sep)
- len = sep - unc;
+ len = sep - hostname;
else
cFYI(1, "%s: probably server name is whole unc: %s",
__func__, unc);