From 16253e33aa5d50da4006be1b8cc14316662934d9 Mon Sep 17 00:00:00 2001 From: "xiao.xinmiao" Date: Thu, 3 Jun 2021 20:56:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bug=EF=BC=9Aslice=20bounds=20out=20of=20r?= =?UTF-8?q?ange?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/aliyun/tool.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/aliyun/tool.go b/app/aliyun/tool.go index 1690fbd..27a99e9 100644 --- a/app/aliyun/tool.go +++ b/app/aliyun/tool.go @@ -395,6 +395,9 @@ func SubString(str string , begin int ,length int) (substr string) { if begin >= lth { begin = lth } + if length < 0 { + length = 0 + } end := begin + length if end > lth { end = lth