From fff818fe878ca5edfbac85b15e77ada2acb8ea0f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 1 Dec 2014 20:15:52 -0500 Subject: libdraw, libframe, acme: fix, guard against inverted range in textsetselect Credit to Roi Martin for noticing that libdraw was being passed a negative string length and for finding the sequence of keystrokes that make acme do it reproducibly. Change-Id: If3f3d04a25c506175f740d3e887d5d83b5cd1bfe Reviewed-on: https://plan9port-review.googlesource.com/1092 Reviewed-by: Russ Cox --- src/libframe/frdraw.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libframe') diff --git a/src/libframe/frdraw.c b/src/libframe/frdraw.c index 2a3a95e0..05a45fe2 100644 --- a/src/libframe/frdraw.c +++ b/src/libframe/frdraw.c @@ -62,6 +62,9 @@ frdrawsel0(Frame *f, Point pt, ulong p0, ulong p1, Image *back, Image *text) Point qt; uint p; char *ptr; + + if(p0 > p1) + sysfatal("libframe: frdrawsel0 p0=%lud > p1=%lud", p0, p1); p = 0; b = f->box; -- cgit v1.2.3