git: 9front

Download patch

ref: b19b8ec30fa0f650179ca33ff2bb715bd71661de
parent: 84f6061a92d92f6f0136f7d6ab42fa03c38d5a78
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sun Dec 2 07:32:23 EST 2012

ape: fix buffer overflow in _envsetup()

--- a/sys/src/ape/lib/ap/plan9/_envsetup.c
+++ b/sys/src/ape/lib/ap/plan9/_envsetup.c
@@ -59,6 +59,8 @@
 	for(j=0; j<nd; j++){
 		d9 = &d9a[j];
 		n = strlen(d9->name);
+		if(n >= sizeof(name)-4)
+			continue;
 		m = d9->length;
 		i = p - ps;
 		if(i+n+1+m+1 > psize) {
--