[PATCH] locale: Avoid zero-length array in _nl_category_names [BZ #24962]
Jeff Law
law@redhat.com
Thu Sep 5 13:26:00 GMT 2019
On 9/5/19 1:34 AM, Florian Weimer wrote:
> (Martin, can you give this a test using GCC 10? I don't expect any
> issues because the zero-length array is completely gone. The patch
> passed testing on x86_64-linux-gnu without regressions, but with GCC 9.)
>
> The union wrapper is unnecessary because C allows to read any object
> as a sequence of chars.
>
> 2019-09-05 Florian Weimer <fweimer@redhat.com>
>
> [BZ #24962]
> * locale/localeinfo.h (_nl_category_names): Remove union wrapper.
> (_nl_category_names_get): New function.
> * intl/dcigettext.c (category_to_name): Call it.
> * locale/findlocale.c (_nl_find_locale): Likewise.
> * intl/loadlocale.c (_nl_load_locale): Likewise.
> * locale/newlocale.c (__newlocale): Likewise.
> * locale/setlocale.c (_nl_category_names): Adjust definition.
> (_nl_category_name_idxs): Likewise.
> (new_composite_name): Call _nl_category_names_get.
> (setlocale): Likewise.
Might be easier for me than Martin. I just threw it into my github
repo, so my tester will pick it up as of now. Will report back in a few
hours.
jeff
More information about the Libc-alpha
mailing list