bash-4.2-015.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.2
  4. Patch-ID: bash42-015
  5. Bug-Reported-by: <dnade.ext@orange-ftgroup.com>
  6. Bug-Reference-ID: <728_1312188080_4E3666B0_728_118711_1_3B5D3E0F95CC5C478D6500CDCE8B691F7AAAA4AA3D@PUEXCB2B.nanterre.francetelecom.fr>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-08/msg00000.html
  8. Bug-Description:
  9. When in a context where arithmetic evaluation is not taking place, the
  10. evaluator should not check for division by 0.
  11. Patch (apply with `patch -p0'):
  12. *** ../bash-4.2-patched/expr.c 2010-12-21 11:12:13.000000000 -0500
  13. --- ./expr.c 2011-08-02 20:58:28.000000000 -0400
  14. ***************
  15. *** 477,480 ****
  16. --- 481,492 ----
  17. if (special)
  18. {
  19. + if ((op == DIV || op == MOD) && value == 0)
  20. + {
  21. + if (noeval == 0)
  22. + evalerror (_("division by 0"));
  23. + else
  24. + value = 1;
  25. + }
  26. +
  27. switch (op)
  28. {
  29. ***************
  30. *** 483,493 ****
  31. break;
  32. case DIV:
  33. - if (value == 0)
  34. - evalerror (_("division by 0"));
  35. lvalue /= value;
  36. break;
  37. case MOD:
  38. - if (value == 0)
  39. - evalerror (_("division by 0"));
  40. lvalue %= value;
  41. break;
  42. --- 495,501 ----
  43. ***************
  44. *** 805,809 ****
  45. if (((op == DIV) || (op == MOD)) && (val2 == 0))
  46. ! evalerror (_("division by 0"));
  47. if (op == MUL)
  48. --- 813,822 ----
  49. if (((op == DIV) || (op == MOD)) && (val2 == 0))
  50. ! {
  51. ! if (noeval == 0)
  52. ! evalerror (_("division by 0"));
  53. ! else
  54. ! val2 = 1;
  55. ! }
  56. if (op == MUL)
  57. *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
  58. --- ./patchlevel.h Thu Feb 24 21:41:34 2011
  59. ***************
  60. *** 26,30 ****
  61. looks for to find the patch level (for the sccs version string). */
  62. ! #define PATCHLEVEL 14
  63. #endif /* _PATCHLEVEL_H_ */
  64. --- 26,30 ----
  65. looks for to find the patch level (for the sccs version string). */
  66. ! #define PATCHLEVEL 15
  67. #endif /* _PATCHLEVEL_H_ */