File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -539,8 +539,8 @@ impl Session {
539539 debug ! ( "channel_window_adjust amount: {:?}" , amount) ;
540540 if let Some ( ref mut enc) = self . common . encrypted {
541541 if let Some ( ref mut channel) = enc. channels . get_mut ( & channel_num) {
542- channel . recipient_window_size += amount;
543- new_size = channel. recipient_window_size ;
542+ new_size = channel . recipient_window_size . saturating_add ( amount) ;
543+ channel. recipient_window_size = new_size ;
544544 } else {
545545 return Err ( crate :: Error :: WrongChannel . into ( ) ) ;
546546 }
Original file line number Diff line number Diff line change @@ -659,8 +659,8 @@ impl Session {
659659 let mut new_size = 0 ;
660660 if let Some ( ref mut enc) = self . common . encrypted {
661661 if let Some ( channel) = enc. channels . get_mut ( & channel_num) {
662- channel . recipient_window_size += amount;
663- new_size = channel. recipient_window_size ;
662+ new_size = channel . recipient_window_size . saturating_add ( amount) ;
663+ channel. recipient_window_size = new_size ;
664664 } else {
665665 return Err ( Error :: WrongChannel . into ( ) ) ;
666666 }
You can’t perform that action at this time.
0 commit comments