From 482cc1a5f135e5c6f66f124ec134e6423fbae115 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 11 Apr 2017 01:08:04 -0400 Subject: Reject malformed messages from RPC UART, not just too-short ones. --- cryptech_muxd | 5 +++-- 1 file 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): -- cgit v1.2.3