components/bash/patches/solaris-008.xmbsrtowcs.c.patch
author Enrico Perla <enrico.perla@oracle.com>
Fri, 04 Nov 2016 05:32:50 -0700
changeset 7245 934578b959f0
parent 5518 c47fe0edc204
child 7485 89b2d849f322
permissions -rw-r--r--
20029192 Userland should build with ld -z sx=nx* flags instead of map.noexstk 23118364 Enable ADIHEAP on security sensitive binaries 23118359 Build openssh as PIE

# Setting the freed pointer to NULL after free'ing
# prevents it from being double-free'd.
# Solaris-specific patch.
--- lib/glob/xmbsrtowcs.c	2010-05-30 15:36:27.000000000 -0700
+++ lib/glob/xmbsrtowcs.c	2011-11-29 09:34:23.471481937 -0800
@@ -36,7 +36,7 @@
 #if HANDLE_MULTIBYTE
 
 #ifndef FREE
-#  define FREE(x)	do { if (x) free (x); } while (0)
+#  define FREE(x)	do { if (x) free (x); x = 0; } while (0)
 #endif
 
 #if ! HAVE_STRCHRNUL