Skip to content

Commit

Permalink
Fixing check of 2x null-bytes ending REG_MULTI_SZ values
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielg5 committed Aug 5, 2024
1 parent 170b542 commit 90724a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions impacket/dcerpc/v5/rrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,9 +702,9 @@ def packValue(valueType, value):
retData = value.decode(sys.getfilesystemencoding()).encode('utf-16le')
elif valueType == REG_MULTI_SZ:
try:
# REG_MULTI_SZ must end with 2 null-bytes
v = checkNullString(value)
if v[-2:] != '\x00':
# REG_MULTI_SZ must end with 2 null-bytes
if v[-2:-1] != '\x00':
v = v + '\x00'
retData = v.encode('utf-16le')
except UnicodeDecodeError:
Expand Down

0 comments on commit 90724a5

Please sign in to comment.