mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-21 11:39:57 +03:00
Log bad remote commands
This commit is contained in:
parent
5c9aa6a21a
commit
a6da0ac6ca
@ -58,8 +58,10 @@ def parse_cmd(serialized_cmd: memoryview, encryption_key: EllipticCurveKey) -> D
|
||||
try:
|
||||
pcmd = json.loads(bytes(serialized_cmd))
|
||||
except Exception:
|
||||
log_error('Failed to parse JSON payload of remote command, ignoring it')
|
||||
return {}
|
||||
if not isinstance(pcmd, dict) or 'version' not in pcmd:
|
||||
log_error('JSON payload of remote command is invalid, must be an object with a version field')
|
||||
return {}
|
||||
pcmd.pop('password', None)
|
||||
if 'encrypted' in pcmd:
|
||||
|
Loading…
Reference in New Issue
Block a user