projects
/
lightning.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f35bf68
)
Fix array index out of bounds.
author
Tom Clegg <tom@tomclegg.ca>
Mon, 20 Sep 2021 13:20:30 +0000
(09:20 -0400)
committer
Tom Clegg <tom@tomclegg.ca>
Mon, 20 Sep 2021 13:20:30 +0000
(09:20 -0400)
refs #17966
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>
slicenumpy.go
patch
|
blob
|
history
diff --git
a/slicenumpy.go
b/slicenumpy.go
index 88fd817537a3020552e04032a345cef2d7ba0bc8..2fc2fd6149c0bf546a758cd58b99d8f3535971c8 100644
(file)
--- a/
slicenumpy.go
+++ b/
slicenumpy.go
@@
-263,8
+263,10
@@
func (cmd *sliceNumpy) RunCommand(prog string, args []string, stdin io.Reader, s
count := make([]tileVariantID, len(variants))
for _, cg := range cgs {
idx := (tag - tagstart) * 2
- count[cg.Variants[idx]]++
- count[cg.Variants[idx+1]]++
+ if int(idx) < len(cg.Variants) {
+ count[cg.Variants[idx]]++
+ count[cg.Variants[idx+1]]++
+ }
}
ranked := make([]tileVariantID, len(variants))
for i := range ranked {