]> Cypherpunks repositories - gostls13.git/commitdiff
big: fix memory corruption in nat.shr
authorRuss Cox <rsc@golang.org>
Mon, 3 May 2010 21:28:45 +0000 (14:28 -0700)
committerRuss Cox <rsc@golang.org>
Mon, 3 May 2010 21:28:45 +0000 (14:28 -0700)
R=gri
CC=golang-dev
https://golang.org/cl/1084041

src/pkg/big/nat.go

index 30ca1e646bc18b6a6096bf42f96299c41173c698..fd4c49f5cf5f1b732e961787ceaef926c360ac9d 100755 (executable)
@@ -785,7 +785,7 @@ func (z nat) shr(x nat, s uint) nat {
        }
 
        z = z.make(n)
-       shrVW(&z[0], &x[m-n], Word(s%_W), m)
+       shrVW(&z[0], &x[m-n], Word(s%_W), n)
 
        return z.norm()
 }