]> git.ipfire.org Git - thirdparty/bash.git/commitdiff
Bash-5.2 patch 2: fix crash in readline when started with an invalid locale specification
authorChet Ramey <chet.ramey@case.edu>
Wed, 5 Oct 2022 14:37:38 +0000 (10:37 -0400)
committerChet Ramey <chet.ramey@case.edu>
Wed, 5 Oct 2022 14:37:38 +0000 (10:37 -0400)
lib/readline/nls.c
patchlevel.h

index 5c6a13b6e9ce6687b72410cf29c399215aef0003..8c027d6be500d06d90a7549e70127c3ba16093a6 100644 (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
index c0dbb500db97e7042515f518c3011848d8cbfa76..d465c2443c964c80fa2bbeb5b3192e49a6f7c038 100644 (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_ */