Skip to content

Commit d8f2799

Browse files
metze-sambaSteve French
authored andcommitted
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 066ce68, where 'ref += le16_to_cpu(ref->Size);' got lost, but that was also wrong... Cc: <[email protected]> Signed-off-by: Stefan Metzmacher <[email protected]> Tested-by: Björn Jacke <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent a557b97 commit d8f2799

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/cifs/cifssmb.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4844,8 +4844,12 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
48444844
max_len = data_end - temp;
48454845
node->node_name = cifs_strndup_from_utf16(temp, max_len,
48464846
is_unicode, nls_codepage);
4847-
if (!node->node_name)
4847+
if (!node->node_name) {
48484848
rc = -ENOMEM;
4849+
goto parse_DFS_referrals_exit;
4850+
}
4851+
4852+
ref++;
48494853
}
48504854

48514855
parse_DFS_referrals_exit:

0 commit comments

Comments
 (0)