r1246 - in trunk: . scripts/patches scripts/scripts/native-scripts scripts/scripts/target-scripts

ryan at linuxfromscratch.org ryan at linuxfromscratch.org
Fri Mar 10 02:07:33 PST 2006


Author: ryan
Date: 2006-03-10 03:07:32 -0700 (Fri, 10 Mar 2006)
New Revision: 1246

Added:
   trunk/scripts/patches/gawk-3.1.5-segfault_fix-1.patch
Modified:
   trunk/
   trunk/scripts/scripts/native-scripts/native-gawk.sh
   trunk/scripts/scripts/target-scripts/target-gawk.sh
Log:
 r1296 at rei:  lfs | 2006-03-09 18:34:49 +1100
 Add gawk-3.1.5-segfault_fix-1.patch
 -----------------------------------
 Submitted By: Matthew Burgess <matthew at linuxfromscratch.org>
 Date: 2005-09-24
 Initial Package Version: 3.1.5
 Upstream Status: From Upstream
 Origin: http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/msg00047.html
 Description: Fixes a bug which causes gawk to segfault when operating on a non-existent file.
 



Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 27a90bee-6a05-0410-9baa-d6d48c78a963:/local:705
27a90bee-6a05-0410-9baa-d6d48c78a963:/trunk:1295
c4644617-e5f8-0310-a1f2-9ce34ac0f9cb:/cross-lfs:564
   + 27a90bee-6a05-0410-9baa-d6d48c78a963:/local:705
27a90bee-6a05-0410-9baa-d6d48c78a963:/trunk:1296
c4644617-e5f8-0310-a1f2-9ce34ac0f9cb:/cross-lfs:564

Added: trunk/scripts/patches/gawk-3.1.5-segfault_fix-1.patch
===================================================================
--- trunk/scripts/patches/gawk-3.1.5-segfault_fix-1.patch	                        (rev 0)
+++ trunk/scripts/patches/gawk-3.1.5-segfault_fix-1.patch	2006-03-10 10:07:32 UTC (rev 1246)
@@ -0,0 +1,43 @@
+Submitted By: Matthew Burgess <matthew at linuxfromscratch.org>
+Date: 2005-09-24
+Initial Package Version: 3.1.5
+Upstream Status: From Upstream
+Origin: http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/msg00047.html
+Description: Fixes a bug which causes gawk to segfault when operating on a non-existent file.
+
+diff -Naur gawk-3.1.5.orig/io.c gawk-3.1.5/io.c
+--- gawk-3.1.5.orig/io.c	2005-07-26 18:07:43.000000000 +0000
++++ gawk-3.1.5/io.c	2005-09-24 14:43:13.771380264 +0000
+@@ -2480,9 +2480,12 @@
+ {
+ 	struct stat sbuf;
+ 	struct open_hook *oh;
++	int iop_malloced = FALSE;
+ 
+-	if (iop == NULL)
++	if (iop == NULL) {
+ 		emalloc(iop, IOBUF *, sizeof(IOBUF), "iop_alloc");
++		iop_malloced = TRUE;
++	}
+ 	memset(iop, '\0', sizeof(IOBUF));
+ 	iop->flag = 0;
+ 	iop->fd = fd;
+@@ -2495,7 +2498,8 @@
+ 	}
+ 
+ 	if (iop->fd == INVALID_HANDLE) {
+-		free(iop);
++		if (iop_malloced)
++			free(iop);
+ 		return NULL;
+ 	}
+ 	if (isatty(iop->fd))
+@@ -2503,7 +2507,7 @@
+ 	iop->readsize = iop->size = optimal_bufsize(iop->fd, & sbuf);
+ 	iop->sbuf = sbuf;
+ 	if (do_lint && S_ISREG(sbuf.st_mode) && sbuf.st_size == 0)
+-			lintwarn(_("data file `%s' is empty"), name);
++		lintwarn(_("data file `%s' is empty"), name);
+ 	errno = 0;
+ 	iop->count = iop->scanoff = 0;
+ 	emalloc(iop->buf, char *, iop->size += 2, "iop_alloc");

Modified: trunk/scripts/scripts/native-scripts/native-gawk.sh
===================================================================
--- trunk/scripts/scripts/native-scripts/native-gawk.sh	2006-03-10 10:07:10 UTC (rev 1245)
+++ trunk/scripts/scripts/native-scripts/native-gawk.sh	2006-03-10 10:07:32 UTC (rev 1246)
@@ -17,6 +17,10 @@
 unpack_tarball gawk-${GAWK_VER} &&
 cd ${PKGDIR}
 
+case ${GAWK_VER} in
+   3.1.5 )  apply_patch gawk-3.1.5-segfault_fix-1 ;;
+esac
+
 # Following mimics gawk patch
 files="Makefile.in awklib/Makefile.in"
 for file in ${files}; do

Modified: trunk/scripts/scripts/target-scripts/target-gawk.sh
===================================================================
--- trunk/scripts/scripts/target-scripts/target-gawk.sh	2006-03-10 10:07:10 UTC (rev 1245)
+++ trunk/scripts/scripts/target-scripts/target-gawk.sh	2006-03-10 10:07:32 UTC (rev 1246)
@@ -33,6 +33,10 @@
    BUILD=`echo ${BUILD} | sed 's@\([_a-zA-Z0-9]*\)\(-[_a-zA-Z0-9]*\)\(.*\)@\1\2x\3@'`
 fi
 
+case ${GAWK_VER} in
+   3.1.5 )  apply_patch gawk-3.1.5-segfault_fix-1 ;;
+esac
+
 # gawk is braindead for setting version information
 # during install while cross compiling, here we will use
 # gawk-$(PACKAGE_VERSION) instead of trying to run gawk --version




More information about the cross-lfs mailing list