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."""
|
"""Read json data from the client."""
|
||||||
while self._socket.canReadLine():
|
while self._socket.canReadLine():
|
||||||
data = bytes(self._socket.readLine())
|
data = bytes(self._socket.readLine())
|
||||||
|
try:
|
||||||
decoded = data.decode('utf-8')
|
decoded = data.decode('utf-8')
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
args = json.loads(decoded)
|
args = json.loads(decoded)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return
|
return
|
||||||
else:
|
|
||||||
app = objreg.get('app')
|
app = objreg.get('app')
|
||||||
app.process_args(args)
|
app.process_args(args)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user