136-upstream-bash43-036.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.3
  4. Patch-ID: bash43-036
  5. Bug-Reported-by: emanuelczirai@cryptolab.net
  6. Bug-Reference-ID: <f962e4f556da5ebfadaf7afe9c78a8cb@cryptolab.net>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2015-02/msg00071.html
  8. Bug-Description:
  9. When evaluating and setting integer variables, and the assignment fails to
  10. create a variable (for example, when performing an operation on an array
  11. variable with an invalid subscript), bash attempts to dereference a null
  12. pointer, causing a segmentation violation.
  13. Patch (apply with `patch -p0'):
  14. --- a/variables.c
  15. +++ b/variables.c
  16. @@ -2833,10 +2833,12 @@ bind_int_variable (lhs, rhs)
  17. #endif
  18. v = bind_variable (lhs, rhs, 0);
  19. - if (v && isint)
  20. - VSETATTR (v, att_integer);
  21. -
  22. - VUNSETATTR (v, att_invisible);
  23. + if (v)
  24. + {
  25. + if (isint)
  26. + VSETATTR (v, att_integer);
  27. + VUNSETATTR (v, att_invisible);
  28. + }
  29. return (v);
  30. }
  31. --- a/patchlevel.h
  32. +++ b/patchlevel.h
  33. @@ -25,6 +25,6 @@
  34. regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
  35. looks for to find the patch level (for the sccs version string). */
  36. -#define PATCHLEVEL 35
  37. +#define PATCHLEVEL 36
  38. #endif /* _PATCHLEVEL_H_ */