From 7a07e605ebcc92990e4e849aeb1465e94bfc07c7 Mon Sep 17 00:00:00 2001 From: Janet Liang Date: Sun, 3 May 2020 15:28:17 -0700 Subject: [PATCH] [node] Patch for panic on slice out of bounds --- node/node_handler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/node_handler.go b/node/node_handler.go index 056cad31bb..78a4abe93f 100644 --- a/node/node_handler.go +++ b/node/node_handler.go @@ -56,6 +56,9 @@ func (node *Node) receiveGroupMessage( } //utils.Logger().Info("[PUBSUB]", "received group msg", len(msg), "sender", sender) // skip the first 5 bytes, 1 byte is p2p type, 4 bytes are message size + if len(msg) < 5 { + continue + } if err := rxQueue.AddMessage(msg[5:], sender); err != nil { utils.Logger().Warn().Err(err). Str("sender", sender.Pretty()).