From: Pengpeng Dong Subject: [PATCH] conhost: Validate screen_buffer->width param in fill_output. Message-Id: <4363fba7-bce7-812b-3266-47ac1abe8157@uniontech.com> Date: Thu, 24 Sep 2020 10:19:41 +0800 From 330d269e5e28d47774e4cd71ff9f965c66a13fa5 Mon Sep 17 00:00:00 2001 From: Pengpeng Dong Date: Thu, 24 Sep 2020 10:11:12 +0800 Subject: [PATCH] conhost: Validate screen_buffer->width param in fill_output. Signed-off-by: Pengpeng Dong --- programs/conhost/conhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/conhost/conhost.c b/programs/conhost/conhost.c index ed52838528..8f930240a9 100644 --- a/programs/conhost/conhost.c +++ b/programs/conhost/conhost.c @@ -2170,7 +2170,7 @@ static NTSTATUS fill_output( struct screen_buffer *screen_buffer, const struct c 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 && params->x >= screen_buffer->width) return STATUS_SUCCESS; if (params->wrap) end = screen_buffer->data + screen_buffer->height * screen_buffer->width; -- 2.20.1