diff options
author | Rob Austein <sra@hactrn.net> | 2017-04-11 01:08:04 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2017-04-11 01:08:04 -0400 |
commit | 482cc1a5f135e5c6f66f124ec134e6423fbae115 (patch) | |
tree | 5c5d152a80955c64eb00a7b150a7e511d47e835c /cryptech_muxd | |
parent | c6f35b5afc9a829b1c03a9f8d0876e1448e5a686 (diff) |
Reject malformed messages from RPC UART, not just too-short ones.
Diffstat (limited to 'cryptech_muxd')
-rwxr-xr-x | cryptech_muxd | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cryptech_muxd b/cryptech_muxd index 269ac15..dacf889 100755 --- a/cryptech_muxd +++ b/cryptech_muxd @@ -166,11 +166,12 @@ class RPCIOStream(SerialIOStream): logger.debug("RPC recv: %s", ":".join("{:02x}".format(ord(c)) for c in reply)) try: handle = client_handle_get(slip_decode(reply)) + queue = self.queues[handle] except: continue logger.debug("RPC queue put: handle 0x%x, qsize %s, maxsize %s", - handle, self.queues[handle].qsize(), self.queues[handle].maxsize) - self.queues[handle].put_nowait(reply) + handle, queue.qsize(), queue.maxsize) + queue.put_nowait(reply) class QueuedStreamClosedError(tornado.iostream.StreamClosedError): |