Skip to content

Commit

Permalink
fs/cifs: fix parsing of dfs referrals
Browse files Browse the repository at this point in the history
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: <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>
  • Loading branch information
Stefan Metzmacher authored and Steve French committed May 4, 2012
1 parent a557b97 commit d8f2799
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fs/cifs/cifssmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -4844,8 +4844,12 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
max_len = data_end - temp;
node->node_name = cifs_strndup_from_utf16(temp, max_len,
is_unicode, nls_codepage);
if (!node->node_name)
if (!node->node_name) {
rc = -ENOMEM;
goto parse_DFS_referrals_exit;
}

ref++;
}

parse_DFS_referrals_exit:
Expand Down

0 comments on commit d8f2799

Please sign in to comment.