Ignore invalid UTF-8 data.
This commit is contained in:
parent
7d492d7556
commit
879cdf8904
@ -97,12 +97,14 @@ class IPCServer(QObject):
|
||||
"""Read json data from the client."""
|
||||
while self._socket.canReadLine():
|
||||
data = bytes(self._socket.readLine())
|
||||
try:
|
||||
decoded = data.decode('utf-8')
|
||||
except UnicodeDecodeError:
|
||||
return
|
||||
try:
|
||||
args = json.loads(decoded)
|
||||
except ValueError:
|
||||
return
|
||||
else:
|
||||
app = objreg.get('app')
|
||||
app.process_args(args)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user