ape: fix buffer overflow in _envsetup()

This commit is contained in:
cinap_lenrek 2012-12-02 12:32:23 +01:00
parent 50c9769bbd
commit 45b498c027

View file

@ -59,6 +59,8 @@ _envsetup(void)
for(j=0; j<nd; j++){ for(j=0; j<nd; j++){
d9 = &d9a[j]; d9 = &d9a[j];
n = strlen(d9->name); n = strlen(d9->name);
if(n >= sizeof(name)-4)
continue;
m = d9->length; m = d9->length;
i = p - ps; i = p - ps;
if(i+n+1+m+1 > psize) { if(i+n+1+m+1 > psize) {