diff --git a/impacket/smbserver.py b/impacket/smbserver.py index 7b1681e01c..255d6fd790 100644 --- a/impacket/smbserver.py +++ b/impacket/smbserver.py @@ -1,6 +1,6 @@ # Impacket - Collection of Python classes for working with network protocols. # -# Copyright Fortra, LLC and its affiliated companies +# Copyright Fortra, LLC and its affiliated companies # # All rights reserved. # @@ -3759,7 +3759,7 @@ def smb2QueryDirectory(connId, smbServer, recvPacket): lenData = len(data) padLen = (8 - (lenData % 8)) % 8 - # For larger directory we might reach the OutputBufferLength so we need to set + # For larger directory we might reach the OutputBufferLength so we need to set # the NextEntryOffset to 0 for the last entry the will fit the buffer try: # Check if the next data will exceed the OutputBufferLength @@ -4635,9 +4635,8 @@ def processRequest(self, connId, data): finalData = [] totalPackets = len(packetsToSend) for idx, packet in enumerate(packetsToSend): - padLen = 0 + padLen = -len(packet) % 8 if idx + 1 < totalPackets: - padLen = -len(packet) % 8 packet['NextCommand'] = len(packet) + padLen if connData['SignatureEnabled']: