From 5171dcb98226332ba27c4d037367100b8564997b Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Tue, 13 Oct 2015 20:33:12 +0100 Subject: [PATCH] Check the x argument to check_boundary() more carefully. This is a minimal fix for CVE-2015-5309, and while it's probably unnecessary now, it seems worth committing for defence in depth and to give downstreams something reasonably non-intrusive to cherry-pick. --- terminal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terminal.c b/terminal.c index 7aafb58b..26a3f0c9 100644 --- a/terminal.c +++ b/terminal.c @@ -2344,7 +2344,7 @@ static void check_boundary(Terminal *term, int x, int y) termline *ldata; /* Validate input coordinates, just in case. */ - if (x == 0 || x > term->cols) + if (x <= 0 || x > term->cols) return; ldata = scrlineptr(y);