Bash-5.2 patch 2: fix crash in readline when started with an invalid locale specification

This commit is contained in:
Chet Ramey
2022-10-05 10:37:38 -04:00
parent a1e58b8c06
commit a99d905216
2 changed files with 5 additions and 1 deletions
+4
View File
@@ -141,6 +141,10 @@ _rl_init_locale (void)
if (lspec == 0)
lspec = "";
ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */
if (ret == 0 || *ret == 0)
ret = setlocale (LC_CTYPE, (char *)NULL);
if (ret == 0 || *ret == 0)
ret = RL_DEFAULT_LOCALE;
#else
ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec;
#endif
+1 -1
View File
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
#define PATCHLEVEL 1
#define PATCHLEVEL 2
#endif /* _PATCHLEVEL_H_ */