]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
Bash-4.4 patch 6
authorChet Ramey <chet.ramey@case.edu>
Fri, 20 Jan 2017 16:47:31 +0000 (11:47 -0500)
committerChet Ramey <chet.ramey@case.edu>
Fri, 20 Jan 2017 16:47:31 +0000 (11:47 -0500)
builtins/pushd.def
patchlevel.h

index 82653c479c5f27b8c46989a908dd301d233f6a13..6579e4c8a2049641560edc1f277005b09c196c29 100644 (file)
@@ -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--;
 
index 1bc098b84f43c98059b287b9d16049ec84a76278..14bff9fc9b90c57e2f58dd403bfcb992576943f2 100644 (file)
@@ -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_ */