Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > c8fa6d66de6077698ac8ce90806499b9 > files > 1

gawk-3.1.8-3.fc14.src.rpm

Index: node.c
===================================================================
RCS file: /sources/gawk/gawk-devel/node.c,v
retrieving revision 1.3
diff -u -r1.3 node.c
--- node.c	6 May 2010 19:00:58 -0000	1.3
+++ node.c	27 Oct 2010 17:56:49 -0000
@@ -758,6 +758,15 @@
 
 	assert((n->flags & (STRING|STRCUR)) != 0);
 
+	/*
+	 * Don't convert global null string or global null field
+	 * variables to a wide string. They are both zero-length anyway.
+	 * This also avoids future double-free errors while releasing
+	 * shallow copies, eg. *tmp = *Null_field; free_wstr(tmp);
+	 */
+	if (n == Nnull_string || n == Null_field)
+		return n;
+
 	if ((n->flags & WSTRCUR) != 0) {
 		if (ptr == NULL)
 			return n;