Commit e156a22
authored
fix(prost-codec): checked addition in Codec::decode
If the length of the varint at the beginning of a decoded value plus the payload length reported within it overflows, we can cheat the test for the remaining buffer length, and the `src.split_to(message_length)` call will then cause a panic as `message_length` is a very large value.
Pull-Request: #6467.1 parent 969b707 commit e156a22
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
85 | 88 | | |
86 | 89 | | |
87 | 90 | | |
| |||
0 commit comments