From d715acb050bc84b442a679ad78ca96bc4c699e40 Mon Sep 17 00:00:00 2001 From: Tal Aloni Date: Fri, 28 Jul 2017 14:04:41 +0300 Subject: [PATCH] Corrected assembly of AndX Response chain --- SMBLibrary/Server/SMBServer.SMB1.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SMBLibrary/Server/SMBServer.SMB1.cs b/SMBLibrary/Server/SMBServer.SMB1.cs index 8685d1d..04b4df3 100644 --- a/SMBLibrary/Server/SMBServer.SMB1.cs +++ b/SMBLibrary/Server/SMBServer.SMB1.cs @@ -42,12 +42,17 @@ namespace SMBLibrary.Server reply.Header = header; for (int index = 0; index < responses.Count; index++) { - if (responses[index] is SMBAndXCommand || index == responses.Count - 1) + if (reply.Commands.Count == 0 || + reply.Commands[reply.Commands.Count - 1] is SMBAndXCommand) { reply.Commands.Add(responses[index]); responses.RemoveAt(index); index--; } + else + { + break; + } } EnqueueMessage(state, reply); }