bash44-008 2.2 KB

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