conhost: Improve bound checking in fill_output.
Inspired by Pengpeng Dong's patch. Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ebe3fe536c
commit
f3b8ccb2f7
|
@ -2168,9 +2168,9 @@ static NTSTATUS fill_output( struct screen_buffer *screen_buffer, const struct c
|
||||||
|
|
||||||
TRACE( "(%u %u) mode %u\n", params->x, params->y, params->mode );
|
TRACE( "(%u %u) mode %u\n", params->x, params->y, params->mode );
|
||||||
|
|
||||||
dest = screen_buffer->data + params->y * screen_buffer->width + params->x;
|
|
||||||
|
|
||||||
if (params->y >= screen_buffer->height) return STATUS_SUCCESS;
|
if (params->y >= screen_buffer->height) return STATUS_SUCCESS;
|
||||||
|
dest = screen_buffer->data + min( params->y * screen_buffer->width + params->x,
|
||||||
|
screen_buffer->height * screen_buffer->width );
|
||||||
|
|
||||||
if (params->wrap)
|
if (params->wrap)
|
||||||
end = screen_buffer->data + screen_buffer->height * screen_buffer->width;
|
end = screen_buffer->data + screen_buffer->height * screen_buffer->width;
|
||||||
|
|
Loading…
Reference in New Issue