Re: [RFC] newlib/libc/include/langinfo.h: nl_langinfo enum off by one error causing pointer overwrite

Corinna Vinschen <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
Hi Brian,

On Aug 21 17:58, Brian Inglis wrote:
> if __HAVE_LOCALE_INFO__ is defined, then _NL_MESSAGES_CODESET is defined
> instead of _NL_CTYPE_CODESET

There is no _NL_CTYPE_CODESET, only CODESET, and the value of
_NL_MESSAGES_CODESET is what it is for backward compatibility.

The values must not change.

> demonstration of pointer overwrite by nl_langinfo dump program generated
> with additional langinfo.h hack after fix:

Can you please provide your STC?

> if __HAVE_LOCALE_INFO__ is not defined, then _NL_MESSAGES_CODESET is
> also not defined, so it is unclear if _NL_MESSAGES_CODESET should be
> defined to _NL_CTYPE_CODESET if neither __HAVE_LOCALE_INFO__ nor
> __HAVE_LOCALE_INFO_EXTENDED__ are defined, or added as another field
> depending on those definitions

As I wrote above, the values must not change.  And given _NL_CTYPE_CODESET
doesn't really exist (but CODESET does), I'm not sure I understand the
problem here.  As on Linux we have a value _NL_CTYPE_CODESET_NAME which
is equivalent to CODESET.


Corinna
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.