summary refs log tree commit diff
path: root/intl
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 /intl
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 'intl')
-rw-r--r--intl/dcigettext.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 4df93e2a8e..11f3749457 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -360,8 +360,7 @@ static const char *guess_category_value (int category,
 
 #ifdef _LIBC
 # include "../locale/localeinfo.h"
-# define category_to_name(category) \
-  _nl_category_names.str + _nl_category_name_idxs[category]
+# define category_to_name(category) _nl_category_names_get (category)
 #else
 static const char *category_to_name (int category);
 #endif