Commit 577c235
fix: add bounds checking for integer overflow in convert-llama2c-to-ggml.cpp
- checkpoint_init_weights: Add validation for head_size and seq_len before multiplication
- Use long type to prevent overflow in skip_size calculation
Addresses 4 integer overflow vulnerabilities (CWE-190)
Co-Authored-By: Jake Cosme <[email protected]>1 parent 0487c34 commit 577c235
1 file changed
+6
-1
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
| |||
0 commit comments