Skip to contentSkip to conversation

fs/cifs: fix parsing of dfs referrals

PATCH New Stefan Metzmacher 1 participant 1 message May 3, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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...

---
 fs/cifs/cifssmb.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
fs/cifs/cifssmb.c +5 -1
index f52c5ab..da2f544 100644
@@ -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:
Signature · 1 line
1.7.4.1