|
|
e6eb8e |
From 44bfefc553993613c0aff992bc4f3078d738ee1d Mon Sep 17 00:00:00 2001
|
|
|
e6eb8e |
From: Chet Ramey <chet.ramey@case.edu>
|
|
|
e6eb8e |
Date: Fri, 20 Jan 2017 11:47:31 -0500
|
|
|
e6eb8e |
Subject: [PATCH] Bash-4.4 patch 6
|
|
|
e6eb8e |
|
|
|
e6eb8e |
---
|
|
|
e6eb8e |
builtins/pushd.def | 7 ++++++-
|
|
|
e6eb8e |
patchlevel.h | 2 +-
|
|
|
e6eb8e |
2 files changed, 7 insertions(+), 2 deletions(-)
|
|
|
e6eb8e |
|
|
|
e6eb8e |
diff --git a/builtins/pushd.def b/builtins/pushd.def
|
|
|
e6eb8e |
index 82653c4..6579e4c 100644
|
|
|
e6eb8e |
--- a/builtins/pushd.def
|
|
|
e6eb8e |
+++ b/builtins/pushd.def
|
|
|
e6eb8e |
@@ -365,7 +365,7 @@ popd_builtin (list)
|
|
|
e6eb8e |
break;
|
|
|
e6eb8e |
}
|
|
|
e6eb8e |
|
|
|
e6eb8e |
- if (which > directory_list_offset || (directory_list_offset == 0 && which == 0))
|
|
|
e6eb8e |
+ if (which > directory_list_offset || (which < -directory_list_offset) || (directory_list_offset == 0 && which == 0))
|
|
|
e6eb8e |
{
|
|
|
e6eb8e |
pushd_error (directory_list_offset, which_word ? which_word : "");
|
|
|
e6eb8e |
return (EXECUTION_FAILURE);
|
|
|
e6eb8e |
@@ -387,6 +387,11 @@ popd_builtin (list)
|
|
|
e6eb8e |
remove that directory from the list and shift the remainder
|
|
|
e6eb8e |
of the list into place. */
|
|
|
e6eb8e |
i = (direction == '+') ? directory_list_offset - which : which;
|
|
|
e6eb8e |
+ if (i < 0 || i > directory_list_offset)
|
|
|
e6eb8e |
+ {
|
|
|
e6eb8e |
+ pushd_error (directory_list_offset, which_word ? which_word : "");
|
|
|
e6eb8e |
+ return (EXECUTION_FAILURE);
|
|
|
e6eb8e |
+ }
|
|
|
e6eb8e |
free (pushd_directory_list[i]);
|
|
|
e6eb8e |
directory_list_offset--;
|
|
|
e6eb8e |
|
|
|
e6eb8e |
diff --git a/patchlevel.h b/patchlevel.h
|
|
|
e6eb8e |
index 1bc098b..14bff9f 100644
|
|
|
e6eb8e |
--- a/patchlevel.h
|
|
|
e6eb8e |
+++ b/patchlevel.h
|
|
|
e6eb8e |
@@ -25,6 +25,6 @@
|
|
|
e6eb8e |
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
|
|
e6eb8e |
looks for to find the patch level (for the sccs version string). */
|
|
|
e6eb8e |
|
|
|
e6eb8e |
-#define PATCHLEVEL 5
|
|
|
e6eb8e |
+#define PATCHLEVEL 6
|
|
|
e6eb8e |
|
|
|
e6eb8e |
#endif /* _PATCHLEVEL_H_ */
|
|
|
e6eb8e |
--
|
|
|
e6eb8e |
2.9.3
|
|
|
e6eb8e |
|