Remove redundant space, handle double slashes in escape string (#340)

This commit is contained in:
fe7ch
2016-12-11 13:53:44 +03:00
committed by Michel Oosterhof
parent c0aecda450
commit 0fda46b933

View File

@@ -140,7 +140,7 @@ class command_echo(HoneyPotCommand):
# FIXME: Wrap in exception, Python escape cannot handle single digit \x codes (e.g. \x1)
try:
self.write(escape_fn(re.sub('(?<=\\\\)x([0-9a-fA-F]{1})(?=\\\\|\"|\'|\s|$)', 'x0\g<1>',
' '.join(args))).strip('\"\''))
''.join(args).replace('\\\\x', '\\x'))).strip('\"\''))
except ValueError as e:
log.msg("echo command received Python incorrect hex escape")