[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Buglet in es-0.68



> In vec.c, you commented out the for loop in mkvector(), so that the components
> of the vector were not NULL'ed, this caused execve() in forkexec() to fail
> with EFAULT.

you're right.  here's the fix: (to be included in es-0.69)

*** vec.c.old	Fri Oct  9 09:56:32 1992
--- vec.c	Fri Oct  9 09:56:18 1992
***************
*** 6,16 ****
  static Tag VectorTag;
  

  extern Vector *mkvector(int n) {
  	Vector *v = gcalloc(offsetof(Vector, vector[n + 1]), &VectorTag);
  	v->alloclen = n;
  	v->count = 0;
! 	/* int i; for (i = 0; i <= n; i++)
! 		v->vector[i] = NULL; */
  	return v;
  }
  

--- 6,17 ----
  static Tag VectorTag;
  

  extern Vector *mkvector(int n) {
+ 	int i;
  	Vector *v = gcalloc(offsetof(Vector, vector[n + 1]), &VectorTag);
  	v->alloclen = n;
  	v->count = 0;
! 	for (i = 0; i <= n; i++)
! 		v->vector[i] = NULL;
  	return v;
  }