bash44-008.patch 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. From https://ftp.gnu.org/gnu/bash/bash-4.4-patches/bash44-008
  2. Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
  3. BASH PATCH REPORT
  4. =================
  5. Bash-Release: 4.4
  6. Patch-ID: bash44-008
  7. Bug-Reported-by: Koichi MURASE <myoga.murase@gmail.com>
  8. Bug-Reference-ID: <CAFLRLk-V+1AeQ2k=pY7ih6V+MfQ_w8EF3YWL2E+wmLfgKBtzXA@mail.gmail.com>
  9. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2016-11/msg00050.html
  10. Bug-Description:
  11. Under certain circumstances, bash will evaluate arithmetic expressions as
  12. part of reading an expression token even when evaluation is suppressed. This
  13. happens while evaluating a conditional expression and skipping over the
  14. failed branch of the expression.
  15. Patch (apply with `patch -p0'):
  16. *** bash-4.4-patched/expr.c 2015-10-11 14:46:36.000000000 -0400
  17. --- b/expr.c 2016-11-08 11:55:46.000000000 -0500
  18. ***************
  19. *** 579,585 ****
  20. if (curtok == QUES) /* found conditional expr */
  21. {
  22. - readtok ();
  23. - if (curtok == 0 || curtok == COL)
  24. - evalerror (_("expression expected"));
  25. if (cval == 0)
  26. {
  27. --- b/579,582 ----
  28. ***************
  29. *** 588,591 ****
  30. --- b/585,592 ----
  31. }
  32. + readtok ();
  33. + if (curtok == 0 || curtok == COL)
  34. + evalerror (_("expression expected"));
  35. +
  36. val1 = EXP_HIGHEST ();
  37. ***************
  38. *** 594,600 ****
  39. if (curtok != COL)
  40. evalerror (_("`:' expected for conditional expression"));
  41. ! readtok ();
  42. ! if (curtok == 0)
  43. ! evalerror (_("expression expected"));
  44. set_noeval = 0;
  45. if (cval)
  46. --- b/595,599 ----
  47. if (curtok != COL)
  48. evalerror (_("`:' expected for conditional expression"));
  49. !
  50. set_noeval = 0;
  51. if (cval)
  52. ***************
  53. *** 604,608 ****
  54. --- b/603,611 ----
  55. }
  56. + readtok ();
  57. + if (curtok == 0)
  58. + evalerror (_("expression expected"));
  59. val2 = expcond ();
  60. +
  61. if (set_noeval)
  62. noeval--;
  63. *** bash-4.4/patchlevel.h 2016-06-22 14:51:03.000000000 -0400
  64. --- b/patchlevel.h 2016-10-01 11:01:28.000000000 -0400
  65. ***************
  66. *** 26,30 ****
  67. looks for to find the patch level (for the sccs version string). */
  68. ! #define PATCHLEVEL 7
  69. #endif /* _PATCHLEVEL_H_ */
  70. --- b/26,30 ----
  71. looks for to find the patch level (for the sccs version string). */
  72. ! #define PATCHLEVEL 8
  73. #endif /* _PATCHLEVEL_H_ */