d393c329 by astaxie

protect parts's len

1 parent 02c2e162
...@@ -312,6 +312,10 @@ func (c *Controller) GetSecureCookie(Secret, key string) (string, bool) { ...@@ -312,6 +312,10 @@ func (c *Controller) GetSecureCookie(Secret, key string) (string, bool) {
312 312
313 parts := strings.SplitN(val, "|", 3) 313 parts := strings.SplitN(val, "|", 3)
314 314
315 if len(parts) != 3 {
316 return "", false
317 }
318
315 vs := parts[0] 319 vs := parts[0]
316 timestamp := parts[1] 320 timestamp := parts[1]
317 sig := parts[2] 321 sig := parts[2]
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!