aboutsummaryrefslogtreecommitdiffstats
path: root/shells
diff options
context:
space:
mode:
authoreik <eik@FreeBSD.org>2004-08-11 03:04:41 +0800
committereik <eik@FreeBSD.org>2004-08-11 03:04:41 +0800
commit202df7d447d9eeb6785f1a3577ff0efd52486754 (patch)
treefff214bcc50513b20c14a92b9e44c0c78631afd1 /shells
parent26fb7cb829fdb0d8b39134a9dce3bbe919bb7b01 (diff)
downloadfreebsd-ports-gnome-202df7d447d9eeb6785f1a3577ff0efd52486754.tar.gz
freebsd-ports-gnome-202df7d447d9eeb6785f1a3577ff0efd52486754.tar.zst
freebsd-ports-gnome-202df7d447d9eeb6785f1a3577ff0efd52486754.zip
Fix segfault when accessing an unset array
Diffstat (limited to 'shells')
-rw-r--r--shells/bash/Makefile1
-rw-r--r--shells/bash/files/patch-arrayfunc.c16
-rw-r--r--shells/bash3/Makefile1
-rw-r--r--shells/bash3/files/patch-arrayfunc.c16
4 files changed, 34 insertions, 0 deletions
diff --git a/shells/bash/Makefile b/shells/bash/Makefile
index cf82560c341f..6934c16e2180 100644
--- a/shells/bash/Makefile
+++ b/shells/bash/Makefile
@@ -7,6 +7,7 @@
PORTNAME= bash
PORTVERSION= 3.0
+PORTREVISION= 1
CATEGORIES= shells
MASTER_SITES= ${MASTER_SITE_GNU} \
ftp://ftp.cwru.edu/pub/%SUBDIR%/
diff --git a/shells/bash/files/patch-arrayfunc.c b/shells/bash/files/patch-arrayfunc.c
new file mode 100644
index 000000000000..fbccb3cfc528
--- /dev/null
+++ b/shells/bash/files/patch-arrayfunc.c
@@ -0,0 +1,16 @@
+#
+# Fix segfault when accessing an unset array
+#
+# http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00026.html
+#
+--- arrayfunc.c.orig Fri Dec 19 00:03:09 2003
++++ arrayfunc.c Sun Aug 1 20:43:00 2004
+@@ -611,7 +611,7 @@
+ var = find_variable (t);
+
+ free (t);
+- return var;
++ return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var;
+ }
+
+ /* Return a string containing the elements in the array and subscript
diff --git a/shells/bash3/Makefile b/shells/bash3/Makefile
index cf82560c341f..6934c16e2180 100644
--- a/shells/bash3/Makefile
+++ b/shells/bash3/Makefile
@@ -7,6 +7,7 @@
PORTNAME= bash
PORTVERSION= 3.0
+PORTREVISION= 1
CATEGORIES= shells
MASTER_SITES= ${MASTER_SITE_GNU} \
ftp://ftp.cwru.edu/pub/%SUBDIR%/
diff --git a/shells/bash3/files/patch-arrayfunc.c b/shells/bash3/files/patch-arrayfunc.c
new file mode 100644
index 000000000000..fbccb3cfc528
--- /dev/null
+++ b/shells/bash3/files/patch-arrayfunc.c
@@ -0,0 +1,16 @@
+#
+# Fix segfault when accessing an unset array
+#
+# http://lists.gnu.org/archive/html/bug-bash/2004-08/msg00026.html
+#
+--- arrayfunc.c.orig Fri Dec 19 00:03:09 2003
++++ arrayfunc.c Sun Aug 1 20:43:00 2004
+@@ -611,7 +611,7 @@
+ var = find_variable (t);
+
+ free (t);
+- return var;
++ return (var == 0 || invisible_p (var)) ? (SHELL_VAR *)0 : var;
+ }
+
+ /* Return a string containing the elements in the array and subscript