Include bounds check in CursorMove validity

This commit is contained in:
Keith Winstein
2011-10-13 03:39:16 -04:00
parent f0e211a971
commit daf7d44684
+5
View File
@@ -55,6 +55,11 @@ void CursorMove::apply( Framebuffer &fb ) const
Validity ConditionalCursorMove::get_validity( const Framebuffer &fb ) const Validity ConditionalCursorMove::get_validity( const Framebuffer &fb ) const
{ {
if ( (new_row >= fb.ds.get_height())
|| (new_col >= fb.ds.get_width()) ) {
return IncorrectOrExpired;
}
if ( timestamp() < expiration_time ) { if ( timestamp() < expiration_time ) {
return Pending; return Pending;
} }