Commit e66ab0b
committed
fix: cap VecOf pre-allocation to prevent OOM on malformed input
A crafted event log with a large count (e.g. 0xFFFFFFFF) could cause
Vec::with_capacity to attempt allocating ~4GB before any decode occurs.
Cap the pre-allocation to 1024; the Vec will still grow as needed via
push if the actual count is larger.1 parent 06a2347 commit e66ab0b
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments