libdraw, libframe, acme: fix, guard against inverted range in textsetselect

Credit to Roi Martin <jroi.martin@gmail.com> 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 <rsc@swtch.com>
This commit is contained in:
Russ Cox 2014-12-01 20:15:52 -05:00
parent d3a47e14e5
commit fff818fe87
3 changed files with 15 additions and 3 deletions

View file

@ -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;