summaryrefslogtreecommitdiffstats
path: root/package/gawk/gawk-3.1.5-core.patch
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-09-12 23:02:31 +0000
committerMike Frysinger <vapier@gentoo.org>2005-09-12 23:02:31 +0000
commit163511722badd3345bc76a7a132f8f2850953fb2 (patch)
treef09e79aef704cefa9d237b920fec1a274a645da8 /package/gawk/gawk-3.1.5-core.patch
parent80f975a48de92ea6f66eeeb5e20d032a4b9a7c6c (diff)
downloadbuildroot-novena-163511722badd3345bc76a7a132f8f2850953fb2.tar.gz
buildroot-novena-163511722badd3345bc76a7a132f8f2850953fb2.zip
version bump
Diffstat (limited to 'package/gawk/gawk-3.1.5-core.patch')
-rw-r--r--package/gawk/gawk-3.1.5-core.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/package/gawk/gawk-3.1.5-core.patch b/package/gawk/gawk-3.1.5-core.patch
new file mode 100644
index 000000000..17cd188c4
--- /dev/null
+++ b/package/gawk/gawk-3.1.5-core.patch
@@ -0,0 +1,31 @@
+fix an ugly core on a simple script
+
+http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/msg00040.html
+http://lists.gnu.org/archive/html/bug-gnu-utils/2005-08/msg00047.html
+
+--- gawk/io.c
++++ gawk/io.c
+@@ -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))