Commit 6d36e45
committed
fix: validate BytesValue length in KeyValuePair encoding
Fixes #128
Per draft-ietf-moq-transport-15 section 1.4.2, the maximum length of a
BytesValue is 2^16-1 bytes. Previously, the code would accept BytesValues
exceeding this limit during encoding, which could cause protocol violations
when the peer attempts to decode the message. Now checks if the BytesValue
length exceeds u16::MAX before encoding and returns EncodeError::InvalidValue
if the limit is exceeded, matching the existing validation in the decode path.1 parent f1b1d8b commit 6d36e45
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
| |||
271 | 275 | | |
272 | 276 | | |
273 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
274 | 288 | | |
0 commit comments