Commit 4831375
fix: use lzo1x_decompress_safe to prevent stack buffer overflow (#1245)
Replace lzo1x_decompress() with lzo1x_decompress_safe() in
transop_decode_lzo(). The unsafe variant does not enforce the output
buffer size limit, allowing a crafted compressed payload to overflow
the N2N_PKT_BUF_SIZE (2048 byte) stack buffer in handle_PACKET().
The safe variant (already bundled in src/minilzo.c) validates output
bounds during decompression, preventing the overflow.
The post-decompression size check was ineffective because the overflow
had already occurred before the check executed.
CAN-2026-2035137
Co-authored-by: Akhil Koul <akkoul@amazon.com>1 parent 98738bc commit 4831375
1 file changed
Lines changed: 3 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 95 | + | |
| 96 | + | |
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
| |||
0 commit comments