The buflen of a new header was not always set to 0, which would cause SIGSEGVs
when parrot_reallocate tries to copy a non-zero length buffer with a bufstart
of NULL. This would happen when buffers get recycled.

I don't know if new_pmc_header has the same problem, but it also does not
initialize the buffer length. 

Index: resources.c
===================================================================
RCS file: /home/perlcvs/parrot/resources.c,v
retrieving revision 1.56
diff -c -r1.56 resources.c
*** resources.c 20 May 2002 16:16:01 -0000      1.56
--- resources.c 20 May 2002 23:06:31 -0000
***************
*** 279,284 ****
--- 279,286 ----
      return_me->flags = 0;
      /* Don't let it point to garbage memory */
      return_me->bufstart = NULL;
+     /* Use the right length */
+     return_me->buflen = 0;
      /* Return it */
      return return_me;
  }

-- 
Jason
Index: resources.c
===================================================================
RCS file: /home/perlcvs/parrot/resources.c,v
retrieving revision 1.56
diff -c -r1.56 resources.c
*** resources.c 20 May 2002 16:16:01 -0000      1.56
--- resources.c 20 May 2002 23:06:31 -0000
***************
*** 279,284 ****
--- 279,286 ----
      return_me->flags = 0;
      /* Don't let it point to garbage memory */
      return_me->bufstart = NULL;
+     /* Use the right length */
+     return_me->buflen = 0;
      /* Return it */
      return return_me;
  }

Reply via email to