Commit 8c19ff7
committed
fix: resolve range variable address bug in holdout loop (CWE-118)
- Changed loop from 'for _, holdout := range holdouts' to 'for i := range holdouts'
- Created proper pointer 'holdout := &holdouts[i]' to avoid address-of-iteration-variable issue
- This fixes the security warning where all iterations would point to the same memory location
- All tests passing
Resolves Prisma Cloud security scan: Incorrect access of indexable resource1 parent 68b5735 commit 8c19ff7
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
66 | | - | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
| |||
0 commit comments