Codebase list pysmb / ed04ecb
Fix filename buffer size calcuation in CreateRequest TJ Harris 3 years ago
1 changed file(s) with 2 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
369369
370370 def prepare(self, message):
371371 buf = self.filename.encode('UTF-16LE')
372 buf_len = len(buf)
372373 if self.create_context_data:
373374 n = SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE + len(buf)
374375 if n % 8 != 0:
396397 self.create_disp,
397398 self.create_options,
398399 SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE, # NameOffset
399 len(self.filename)*2, # NameLength in bytes
400 buf_len, # Length of encoded filename in bytes
400401 create_context_offset, # CreateContextOffset
401402 len(self.create_context_data) # CreateContextLength
402403 ) + buf