shithub: orca

Download patch

ref: 2bdc2925149b0e1eb200365f709ef8111b1c3c37
parent: 0b97dad21cb36e42fd965cebfb98b70aa08f82de
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sat Feb 15 17:15:29 EST 2020

plan9: selset: fix out of range memset

--- a/plan9.c
+++ b/plan9.c
@@ -477,7 +477,7 @@
 	int y;
 
 	for (y = cury; y < cury+selh && y < field.height; y++)
-		memset(&field.buffer[curx + field.width*y], key, selw);
+		memset(&field.buffer[curx + field.width*y], key, MIN(field.width-curx, selw));
 }
 
 static void