fix(client): reject invalid negotiated packet length
This commit is contained in:
1 parent
e3bb28c559
commit
294d97a13d
2 files changed
+29
No files matched your search
@@ -48,6 +48,11 @@ pub(crate) fn validate_negotiated_params(
|
||||
});
|
||||
}
|
||||
validate_duration_restriction(requested.duration_ns, returned.duration_ns)?;
|
||||
if returned.length < 0 {
|
||||
return Err(ClientError::NegotiationRejected {
|
||||
reason: "length must be non-negative".to_owned(),
|
||||
});
|
||||
}
|
||||
if returned.length > requested.length {
|
||||
return Err(ClientError::NegotiationRejected {
|
||||
reason: "length increased".to_owned(),
|
||||
|
||||
Reference in new issue
Block a user