From 170a0386122d90f4863bb9dfdf433571aec68525 Mon Sep 17 00:00:00 2001 From: maze Date: Thu, 9 Oct 2025 15:37:06 +0200 Subject: [PATCH] Bugfix: fast path for empty magic --- protocol/match.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocol/match.go b/protocol/match.go index 812a4c1..9d64e4e 100644 --- a/protocol/match.go +++ b/protocol/match.go @@ -9,6 +9,9 @@ package protocol // // Returns true if all magic bytes are matched, even if input has extra bytes. func Match(magic string, input []byte) bool { + if len(magic) == 0 { + return true + } return match(magic, input, 0, 0) }