Commit d8f2799b authored by Stefan Metzmacher's avatar Stefan Metzmacher Committed by Steve French

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
066ce689,
where 'ref += le16_to_cpu(ref->Size);' got lost,
but that was also wrong...

Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarStefan Metzmacher <metze@samba.org>
Tested-by: default avatarBjörn Jacke <bj@sernet.de>
Reviewed-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent a557b976
...@@ -4844,8 +4844,12 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr, ...@@ -4844,8 +4844,12 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
max_len = data_end - temp; max_len = data_end - temp;
node->node_name = cifs_strndup_from_utf16(temp, max_len, node->node_name = cifs_strndup_from_utf16(temp, max_len,
is_unicode, nls_codepage); is_unicode, nls_codepage);
if (!node->node_name) if (!node->node_name) {
rc = -ENOMEM; rc = -ENOMEM;
goto parse_DFS_referrals_exit;
}
ref++;
} }
parse_DFS_referrals_exit: parse_DFS_referrals_exit:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment