]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Check the x argument to check_boundary() more carefully.
authorBen Harris <bjh21@bjh21.me.uk>
Tue, 13 Oct 2015 19:33:12 +0000 (20:33 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Tue, 27 Oct 2015 19:59:46 +0000 (19:59 +0000)
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

index c7e2647e8971adbf08d039d83cd96f59c080c9a2..ae85eb58a6a892d2a26c16788707fd6027af70ec 100644 (file)
@@ -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);