]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/twofish: fix Reset index overflow bug.
authorAndrew Gerrand <adg@golang.org>
Mon, 6 Jun 2011 04:30:48 +0000 (14:30 +1000)
committerAndrew Gerrand <adg@golang.org>
Mon, 6 Jun 2011 04:30:48 +0000 (14:30 +1000)
Fixes #1919.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/4530110

src/pkg/crypto/twofish/twofish.go

index 9303f03ffd8bc68b1633bb1e4517c5c09594eac4..1a1aac9b9927a165f935097f1114da262dca72c7 100644 (file)
@@ -116,7 +116,7 @@ func (c *Cipher) Reset() {
                c.k[i] = 0
        }
        for i := range c.s {
-               for j := 0; j < 265; j++ {
+               for j := 0; j < 256; j++ {
                        c.s[i][j] = 0
                }
        }