To reproduce this you need to have /etc/malloc.conf set to fill
with junk.  Below is a simple workaround, there may be a better
solution though.

 - todd

Index: lib.c
===================================================================
RCS file: /cvs/src/usr.bin/awk/lib.c,v
retrieving revision 1.21
diff -u -p -u -r1.21 lib.c
--- lib.c       27 Mar 2015 10:09:30 -0000      1.21
+++ lib.c       7 Apr 2016 02:05:08 -0000
@@ -59,7 +59,7 @@ static Cell dollar1 = { OCELL, CFLD, NUL
 
 void recinit(unsigned int n)
 {
-       if ( (record = (char *) malloc(n)) == NULL
+       if ( (record = (char *) calloc(n, 1)) == NULL
          || (fields = (char *) malloc(n+1)) == NULL
          || (fldtab = (Cell **) calloc(nfields+1, sizeof(Cell *))) == NULL
          || (fldtab[0] = (Cell *) malloc(sizeof(Cell))) == NULL )

Reply via email to