From 070afae9d3bf73dd3a4eaf8c04a9a44ff51ebfda Mon Sep 17 00:00:00 2001 From: Patrick McClurg Date: Tue, 9 Jan 2024 19:11:57 +0100 Subject: [PATCH] fixed panic identified in fuzzing --- internal/dkg/actions_passive.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/dkg/actions_passive.go b/internal/dkg/actions_passive.go index 61940daf3..ec4e12384 100644 --- a/internal/dkg/actions_passive.go +++ b/internal/dkg/actions_passive.go @@ -29,6 +29,9 @@ func (d *Process) Packet(ctx context.Context, packet *drand.GossipPacket) (*dran packetName := packetName(packet) packetSig := hex.EncodeToString(packet.Metadata.Signature) + if len(packetSig) < 8 { + return nil, errors.New("packet signature is too short") + } shortSig := packetSig[0:8] d.log.Debugw("processing DKG gossip packet", "type", packetName, "sig", shortSig) _, span := tracer.NewSpan(ctx, fmt.Sprintf("packet.%s", packetName))