mirror of
https://github.com/astaxie/beego.git
synced 2024-11-29 13:41:28 +00:00
protect parts's len
This commit is contained in:
parent
02c2e16253
commit
d393c329c3
@ -312,6 +312,10 @@ func (c *Controller) GetSecureCookie(Secret, key string) (string, bool) {
|
|||||||
|
|
||||||
parts := strings.SplitN(val, "|", 3)
|
parts := strings.SplitN(val, "|", 3)
|
||||||
|
|
||||||
|
if len(parts) != 3 {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
|
||||||
vs := parts[0]
|
vs := parts[0]
|
||||||
timestamp := parts[1]
|
timestamp := parts[1]
|
||||||
sig := parts[2]
|
sig := parts[2]
|
||||||
|
Loading…
Reference in New Issue
Block a user