From 8b2abfde35f4c36f611d4a28d7790a47605ba801 Mon Sep 17 00:00:00 2001 From: guoqiang Date: Tue, 30 Apr 2024 17:07:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E9=89=B4=E6=9D=83panic,=20fixes=20#100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- io.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/io.go b/io.go index 107ac77..19861ff 100644 --- a/io.go +++ b/io.go @@ -140,6 +140,9 @@ func (io *IO) auth(key string, secret string, expire string) bool { if unixTime, err := strconv.ParseInt(expire, 16, 64); err != nil || time.Now().Unix() > unixTime { return false } + if len(secret) != 32 { + return false + } trueSecret := md5.Sum([]byte(key + io.Stream.Path + expire)) for i := 0; i < 16; i++ { hex, err := strconv.ParseInt(secret[i<<1:(i<<1)+2], 16, 16)