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 /shells/bash/files | |
parent | Unbreak build of p5-[Pp]od* (diff) |
Fix segfault when accessing an unset array
Diffstat (limited to 'shells/bash/files')
-rw-r--r-- | shells/bash/files/patch-arrayfunc.c | 16 |
1 files changed, 16 insertions, 0 deletions
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 |