PERFORCE change 152913 for review

Peter Wemm peter at FreeBSD.org
Wed Nov 12 16:11:45 PST 2008


http://perforce.freebsd.org/chv.cgi?CH=152913

Change 152913 by peter at peter_cheese on 2008/11/13 00:10:51

	Create and initialize an extra slot in the new env[] array for the
	32 bit preload string.

Affected files ...

.. //depot/projects/valgrind/coregrind/m_initimg/initimg-freebsd.c#6 edit

Differences ...

==== //depot/projects/valgrind/coregrind/m_initimg/initimg-freebsd.c#6 (text+ko) ====

@@ -272,13 +272,14 @@
 
    /* Allocate a new space */
    ret = VG_(malloc) ("initimg-linux.sce.3",
-                      sizeof(HChar *) * (envc+1+1)); /* 1 new entry + NULL */
+                      sizeof(HChar *) * (envc+2+1)); /* 2 new entries + NULL */
    vg_assert(ret);
 
    /* copy it over */
    for (cpp = ret; *origenv; )
       *cpp++ = *origenv++;
    *cpp = NULL;
+   *(cpp + 1) = NULL;
    
    vg_assert(envc == (cpp - ret));
 


More information about the p4-projects mailing list