bash52-002.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 5.2
  4. Patch-ID: bash52-002
  5. Bug-Reported-by: Kan-Ru Chen <koster@debian.org>
  6. Bug-Reference-ID:
  7. Bug-Reference-URL: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021109
  8. Bug-Description:
  9. Starting bash with an invalid locale specification for LC_ALL/LANG/LC_CTYPE
  10. can cause the shell to crash.
  11. Patch (apply with `patch -p0'):
  12. *** ../bash-5.2-patched/lib/readline/nls.c 2022-08-15 09:38:51.000000000 -0400
  13. --- lib/readline/nls.c 2022-10-05 09:23:22.000000000 -0400
  14. ***************
  15. *** 142,145 ****
  16. --- 142,149 ----
  17. lspec = "";
  18. ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */
  19. + if (ret == 0 || *ret == 0)
  20. + ret = setlocale (LC_CTYPE, (char *)NULL);
  21. + if (ret == 0 || *ret == 0)
  22. + ret = RL_DEFAULT_LOCALE;
  23. #else
  24. ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec;
  25. *** ../bash-5.2/patchlevel.h 2020-06-22 14:51:03.000000000 -0400
  26. --- patchlevel.h 2020-10-01 11:01:28.000000000 -0400
  27. ***************
  28. *** 26,30 ****
  29. looks for to find the patch level (for the sccs version string). */
  30. ! #define PATCHLEVEL 1
  31. #endif /* _PATCHLEVEL_H_ */
  32. --- 26,30 ----
  33. looks for to find the patch level (for the sccs version string). */
  34. ! #define PATCHLEVEL 2
  35. #endif /* _PATCHLEVEL_H_ */