diff options
author | Oliver Eikemeier <eik@FreeBSD.org> | 2004-08-10 19:04:41 +0000 |
---|---|---|
committer | Oliver Eikemeier <eik@FreeBSD.org> | 2004-08-10 19:04:41 +0000 |
commit | fa4d9be8145f2db524d385f8e2f4387df3a79ad6 (patch) | |
tree | f2d3efa77aa38bf70a4ef376a64b93ea9b24651b | |
parent | 4f7fcd1bccb37848f412426a0b168f0845ac7d68 (diff) | |
download | freebsd-ports-fa4d9be8145f2db524d385f8e2f4387df3a79ad6.zip |
Fix segfault when accessing an unset array
-rw-r--r-- | shells/bash/Makefile | 1 | ||||
-rw-r--r-- | shells/bash/files/patch-arrayfunc.c | 16 | ||||
-rw-r--r-- | shells/bash3/Makefile | 1 | ||||
-rw-r--r-- | shells/bash3/files/patch-arrayfunc.c | 16 |
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 |