0035-patchlevel-35.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From http://ftp.gnu.org/pub/gnu/bash/bash-4.3-patches/bash43-035
  2. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  3. BASH PATCH REPORT
  4. =================
  5. Bash-Release: 4.3
  6. Patch-ID: bash43-035
  7. Bug-Reported-by: <romerox.adrian@gmail.com>
  8. Bug-Reference-ID: <CABV5r3zhPXmSKUe9uedeGc5YFBM2njJ1iVmY2h5neWdQpDBQug@mail.gmail.com>
  9. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-08/msg00045.html
  10. Bug-Description:
  11. A locale with a long name can trigger a buffer overflow and core dump. This
  12. applies on systems that do not have locale_charset in libc, are not using
  13. GNU libiconv, and are not using the libintl that ships with bash in lib/intl.
  14. Patch (apply with `patch -p0'):
  15. *** a/bash-4.3-patched/lib/sh/unicode.c 2014-01-30 16:47:19.000000000 -0500
  16. --- b/lib/sh/unicode.c 2015-05-01 08:58:30.000000000 -0400
  17. ***************
  18. *** 79,83 ****
  19. if (s)
  20. {
  21. ! strcpy (charsetbuf, s+1);
  22. t = strchr (charsetbuf, '@');
  23. if (t)
  24. --- 79,84 ----
  25. if (s)
  26. {
  27. ! strncpy (charsetbuf, s+1, sizeof (charsetbuf) - 1);
  28. ! charsetbuf[sizeof (charsetbuf) - 1] = '\0';
  29. t = strchr (charsetbuf, '@');
  30. if (t)
  31. ***************
  32. *** 85,89 ****
  33. return charsetbuf;
  34. }
  35. ! strcpy (charsetbuf, locale);
  36. return charsetbuf;
  37. }
  38. --- 86,91 ----
  39. return charsetbuf;
  40. }
  41. ! strncpy (charsetbuf, locale, sizeof (charsetbuf) - 1);
  42. ! charsetbuf[sizeof (charsetbuf) - 1] = '\0';
  43. return charsetbuf;
  44. }
  45. *** a/bash-4.3/patchlevel.h 2012-12-29 10:47:57.000000000 -0500
  46. --- b/patchlevel.h 2014-03-20 20:01:28.000000000 -0400
  47. ***************
  48. *** 26,30 ****
  49. looks for to find the patch level (for the sccs version string). */
  50. ! #define PATCHLEVEL 34
  51. #endif /* _PATCHLEVEL_H_ */
  52. --- 26,30 ----
  53. looks for to find the patch level (for the sccs version string). */
  54. ! #define PATCHLEVEL 35
  55. #endif /* _PATCHLEVEL_H_ */