Commit aefd843
fix: add integer overflow checks for calloc in ggml_gallocr_new_n
- Added overflow checks before calloc operations
- Added proper cleanup on allocation failure
- Validates n_bufs parameter
- Prevents integer overflow in buffer allocations
Addresses integer overflow vulnerabilities (CWE-190)
Co-Authored-By: Jake Cosme <[email protected]>1 parent 3baffd2 commit aefd843
1 file changed
+19
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
367 | 371 | | |
368 | 372 | | |
369 | 373 | | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
370 | 378 | | |
371 | 379 | | |
372 | 380 | | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
373 | 386 | | |
374 | 387 | | |
375 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
376 | 395 | | |
377 | 396 | | |
378 | 397 | | |
| |||
0 commit comments