aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher2012-05-03 17:19:28 -0500
committerSteve French2012-05-03 22:47:39 -0500
commitd8f2799b105a24bb0bbd3380a0d56e6348484058 (patch)
tree170d00ed1bb01443fb1b1695f9fcea3adb3d1f10
parenta557b97616c49d81e09c8439831d4c4f13ef4050 (diff)
downloadkernel-common-d8f2799b105a24bb0bbd3380a0d56e6348484058.tar.gz
kernel-common-d8f2799b105a24bb0bbd3380a0d56e6348484058.tar.xz
kernel-common-d8f2799b105a24bb0bbd3380a0d56e6348484058.zip
fs/cifs: fix parsing of dfs referrals
The problem was that the first referral was parsed more than once and so the caller tried the same referrals multiple times. The problem was introduced partly by commit 066ce6899484d9026acd6ba3a8dbbedb33d7ae1b, where 'ref += le16_to_cpu(ref->Size);' got lost, but that was also wrong... Cc: <stable@vger.kernel.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Tested-by: Björn Jacke <bj@sernet.de> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
-rw-r--r--fs/cifs/cifssmb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index f52c5ab78f9..da2f5446fa7 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -4844,8 +4844,12 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
4844 max_len = data_end - temp; 4844 max_len = data_end - temp;
4845 node->node_name = cifs_strndup_from_utf16(temp, max_len, 4845 node->node_name = cifs_strndup_from_utf16(temp, max_len,
4846 is_unicode, nls_codepage); 4846 is_unicode, nls_codepage);
4847 if (!node->node_name) 4847 if (!node->node_name) {
4848 rc = -ENOMEM; 4848 rc = -ENOMEM;
4849 goto parse_DFS_referrals_exit;
4850 }
4851
4852 ref++;
4849 } 4853 }
4850 4854
4851parse_DFS_referrals_exit: 4855parse_DFS_referrals_exit: