bsed / gorilla

Automatically exported from code.google.com/p/gorilla
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Invalid codecs initialization #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create new codecs with two values (one pair)
2. Try getting a session

What is the expected output? What do you see instead?
New session must be returned. A program breaks with nil pointer exception.

Please provide any additional information below.

In the file securecookie.go, in string 345 instead of
    codecs := make([]Codec, len(keyPairs)+len(keyPairs)%2)

must be something like this
    codecs := make([]Codec, len(keyPairs)/2+len(keyPairs)%2)

Original issue reported on code.google.com by hashcode...@gmail.com on 23 Mar 2012 at 7:06

GoogleCodeExporter commented 9 years ago
Sorry for this, it was an annoying one. The issue was fixed a while ago:

http://code.google.com/p/gorilla/source/browse/securecookie/securecookie.go?r=7c
d61e75d176f47b87178547c44816ea4fa7a3ae#350

Update your version and it should be fine now. Thanks for the report.

Original comment by rodrigo.moraes on 23 Mar 2012 at 11:09