Commit 40bdfa5
Fix Coverity CID 1530056: validate tainted allocation size before malloc
Add a bounds check on size_of_preparsed_data (computed from file-sourced
FirstByteOfLinkCollectionArray and NumberLinkCollectionNodes) before
passing it to malloc(). This ensures the tainted scalar values read via
sscanf are sanitized by verifying the allocation size is within a
permissible range (1 MB).
Co-authored-by: Youw <5939659+Youw@users.noreply.github.com>1 parent 1bfe1ff commit 40bdfa5
1 file changed
+5
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| |||
0 commit comments