Commit ee978d7
committed
fix(resp): replace wrapping arithmetic with checked operations in parse_integer
Use checked_mul/checked_add instead of wrapping_mul/wrapping_add to detect integer overflow in the RESP integer parser. Previously, a bulk string length exceeding i64::MAX was silently wrapped, which could lead to incorrect parsing if rustis is used as a proxy with untrusted input.1 parent f113d54 commit ee978d7
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
257 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
0 commit comments