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:
@@ -67,6 +67,9 @@ _string(Image *dst, Point pt, Image *src, Point sp, Font *f, char *s, Rune *r, i
|
||||
Font *def;
|
||||
Subfont *sf;
|
||||
|
||||
if(len < 0)
|
||||
sysfatal("libdraw: _string len=%d", len);
|
||||
|
||||
if(s == nil){
|
||||
s = "";
|
||||
sptr = nil;
|
||||
|
||||
Reference in New Issue
Block a user