summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2017-01-20 11:47:31 -0500
committerChet Ramey <chet.ramey@case.edu>2017-01-20 11:47:31 -0500
commit44bfefc553993613c0aff992bc4f3078d738ee1d (patch)
tree788e74fe5fcf167ac96ebacfc76148ccfc581d62
parentf459cbd8be37b28be1dc90315e0ab51d7f211301 (diff)
downloadbash-44bfefc553993613c0aff992bc4f3078d738ee1d.tar.gz
Bash-4.4 patch 6
-rw-r--r--builtins/pushd.def7
-rw-r--r--patchlevel.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/builtins/pushd.def b/builtins/pushd.def
index 82653c47..6579e4c8 100644
--- a/builtins/pushd.def
+++ b/builtins/pushd.def
@@ -365,7 +365,7 @@ popd_builtin (list)
break;
}
- if (which > directory_list_offset || (directory_list_offset == 0 && which == 0))
+ if (which > directory_list_offset || (which < -directory_list_offset) || (directory_list_offset == 0 && which == 0))
{
pushd_error (directory_list_offset, which_word ? which_word : "");
return (EXECUTION_FAILURE);
@@ -387,6 +387,11 @@ popd_builtin (list)
remove that directory from the list and shift the remainder
of the list into place. */
i = (direction == '+') ? directory_list_offset - which : which;
+ if (i < 0 || i > directory_list_offset)
+ {
+ pushd_error (directory_list_offset, which_word ? which_word : "");
+ return (EXECUTION_FAILURE);
+ }
free (pushd_directory_list[i]);
directory_list_offset--;
diff --git a/patchlevel.h b/patchlevel.h
index 1bc098b8..14bff9fc 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 5
+#define PATCHLEVEL 6
#endif /* _PATCHLEVEL_H_ */