You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
2.5 KiB

  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 5.0
  4. Patch-ID: bash50-008
  5. Bug-Reported-by: Michael Albinus <michael.albinus@gmx.de>
  6. Bug-Reference-ID: <87bm36k3kz.fsf@gmx.de>
  7. Bug-Reference-URL: https://lists.gnu.org/archive/html/bug-bash/2019-02/msg00111.html
  8. Bug-Description:
  9. When HISTSIZE is set to 0, history expansion can leave the history length
  10. set to an incorrect value, leading to subsequent attempts to access invalid
  11. memory.
  12. Patch (apply with `patch -p0'):
  13. *** a/bashhist.c 2018-07-05 22:41:14.000000000 -0400
  14. --- b/bashhist.c 2019-02-20 16:20:04.000000000 -0500
  15. ***************
  16. *** 561,573 ****
  17. if (!history_expansion_inhibited && history_expansion && history_expansion_p (line))
  18. {
  19. /* If we are expanding the second or later line of a multi-line
  20. command, decrease history_length so references to history expansions
  21. in these lines refer to the previous history entry and not the
  22. current command. */
  23. if (history_length > 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
  24. history_length--;
  25. expanded = history_expand (line, &history_value);
  26. if (history_length >= 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
  27. ! history_length++;
  28. if (expanded)
  29. --- 561,576 ----
  30. if (!history_expansion_inhibited && history_expansion && history_expansion_p (line))
  31. {
  32. + int old_len;
  33. +
  34. /* If we are expanding the second or later line of a multi-line
  35. command, decrease history_length so references to history expansions
  36. in these lines refer to the previous history entry and not the
  37. current command. */
  38. + old_len = history_length;
  39. if (history_length > 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
  40. history_length--;
  41. expanded = history_expand (line, &history_value);
  42. if (history_length >= 0 && command_oriented_history && current_command_first_line_saved && current_command_line_count > 1)
  43. ! history_length = old_len;
  44. if (expanded)
  45. *** a/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
  46. --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
  47. ***************
  48. *** 26,30 ****
  49. looks for to find the patch level (for the sccs version string). */
  50. ! #define PATCHLEVEL 7
  51. #endif /* _PATCHLEVEL_H_ */
  52. --- 26,30 ----
  53. looks for to find the patch level (for the sccs version string). */
  54. ! #define PATCHLEVEL 8
  55. #endif /* _PATCHLEVEL_H_ */