summary refs log tree commit diff
path: root/locale/loadlocale.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-09-05 22:16:58 +0200
committerFlorian Weimer <fweimer@redhat.com>2019-09-05 22:16:58 +0200
commitde18a7061c9bdff73d66502c55d6a3ea671fc6d9 (patch)
treed3d4d3a27d9ac4aea5fc088a884cc2ec5f256ce7 /locale/loadlocale.c
parentab41100bab128fa98258aafbb0ab1622884cec4c (diff)
downloadglibc-de18a7061c9bdff73d66502c55d6a3ea671fc6d9.tar.gz
glibc-de18a7061c9bdff73d66502c55d6a3ea671fc6d9.tar.xz
glibc-de18a7061c9bdff73d66502c55d6a3ea671fc6d9.zip
locale: Avoid zero-length array in _nl_category_names [BZ #24962]
The union wrapper is unnecessary because C allows to read any object
as a sequence of chars.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'locale/loadlocale.c')
-rw-r--r--locale/loadlocale.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/locale/loadlocale.c b/locale/loadlocale.c
index 571c94e1de..ff578f6416 100644
--- a/locale/loadlocale.c
+++ b/locale/loadlocale.c
@@ -199,8 +199,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category)
       newp = (char *) alloca (filenamelen
 			      + 5 + _nl_category_name_sizes[category] + 1);
       __mempcpy (__mempcpy (__mempcpy (newp, file->filename, filenamelen),
-			    "/SYS_", 5),
-		 _nl_category_names.str + _nl_category_name_idxs[category],
+			    "/SYS_", 5), _nl_category_names_get (category),
 		 _nl_category_name_sizes[category] + 1);
 
       fd = __open_nocancel (newp, O_RDONLY | O_CLOEXEC);