Commit da5b6cf
fix: add integer overflow checks for calloc in ggml_backend_graph_copy
- Added overflow checks before node_copies allocation
- Added overflow checks before node_init allocation
- Ensures safe memory allocation for graph copy operations
- Added proper cleanup on overflow detection
Addresses integer overflow vulnerability (CWE-190)
Co-Authored-By: Jake Cosme <[email protected]>1 parent 1ab01a0 commit da5b6cf
1 file changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1916 | 1916 | | |
1917 | 1917 | | |
1918 | 1918 | | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
1919 | 1930 | | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
1920 | 1943 | | |
1921 | 1944 | | |
1922 | 1945 | | |
| |||
0 commit comments