Include bounds check in CursorMove validity
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user