summaryrefslogtreecommitdiff
path: root/src/locale
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-04-10 23:21:53 +0200
committerLennart Poettering <lennart@poettering.net>2013-04-10 23:23:19 +0200
commit0affed79d2e30013f07cb94e6f07e3fcb81c02fa (patch)
tree9e925ac3d65ad92405039d67d6398faca2765dc6 /src/locale
parent1ef2af5ae02aede39262dedd9fd358b607450662 (diff)
localctl: skip locale entries with non-UTF8 names
glibc should place these in the locale archive. For now, let's just skip them from our output, since they are aliases anyway. https://bugs.freedesktop.org/show_bug.cgi?id=63389
Diffstat (limited to 'src/locale')
-rw-r--r--src/locale/localectl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index 5328ac41a..095d7f7d3 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -37,6 +37,7 @@
#include "pager.h"
#include "set.h"
#include "path-util.h"
+#include "utf8.h"
static bool arg_no_pager = false;
static enum transport {
@@ -359,6 +360,9 @@ static int add_locales_from_archive(Set *locales) {
if (e[i].locrec_offset == 0)
continue;
+ if (!utf8_is_valid((char*) p + e[i].name_offset))
+ continue;
+
z = strdup((char*) p + e[i].name_offset);
if (!z) {
r = log_oom();