Commit 6952938
Prevent integer overflow when converting CEL's 0-based array indexing
to PostgreSQL's 1-based indexing.
Changes:
- Add overflow detection for math.MaxInt64 in visitCallListIndex()
- Add validation for negative array indices
- Return clear error messages for both cases
- Add comprehensive test coverage
This fixes CWE-190 (Integer Overflow) with severity Critical.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8eed263 commit 6952938
2 files changed
+21
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
1027 | 1028 | | |
1028 | 1029 | | |
1029 | 1030 | | |
1030 | | - | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
1031 | 1039 | | |
1032 | 1040 | | |
1033 | 1041 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
225 | 237 | | |
226 | 238 | | |
227 | 239 | | |
| |||
0 commit comments