-
-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add some missing bounds checks. #260
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -310,7 +310,7 @@ where | |
last_processed_id | ||
} | ||
|
||
pub fn recv_go_away(&mut self, frame: &frame::GoAway) { | ||
pub fn recv_go_away(&mut self, frame: &frame::GoAway) -> Result<(), RecvError> { | ||
let mut me = self.inner.lock().unwrap(); | ||
let me = &mut *me; | ||
|
||
|
@@ -322,6 +322,10 @@ where | |
let last_stream_id = frame.last_stream_id(); | ||
let err = frame.reason().into(); | ||
|
||
if actions.recv.max_stream_id() < last_stream_id { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I got a bit confused with this, until I went digging into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
return Err(RecvError::Connection(Reason::PROTOCOL_ERROR)); | ||
} | ||
|
||
actions.recv.go_away(last_stream_id); | ||
|
||
me.store | ||
|
@@ -337,6 +341,8 @@ where | |
.unwrap(); | ||
|
||
actions.conn_error = Some(err); | ||
|
||
Ok(()) | ||
} | ||
|
||
pub fn recv_eof(&mut self) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there's more involved, but wanted to check: does this addition essentially complete this TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it; I removed the comment.