1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Fix fnmatch strnlen namespace (bug 18470).

fnmatch brings in references to strnlen, which isn't in all the
standards that contain fnmatch (not added until the 2008 edition of
POSIX), resulting in linknamespace test failures.  (This is contrary
to glibc conventions, rather than a standards conformance issue,
because of the str* reservation.)  This patch fixes this in the usual
way, using __strnlen instead of strnlen.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by the patch).

	[BZ #18470]
	* posix/fnmatch.c (fnmatch) [_LIBC]: Call __strnlen instead of
	strnlen.
	* conform/Makefile (test-xfail-XPG3/fnmatch.h/linknamespace):
	Remove variable.
	(test-xfail-XPG4/fnmatch.h/linknamespace): Likewise.
	(test-xfail-POSIX/fnmatch.h/linknamespace): Likewise.
	(test-xfail-POSIX/glob.h/linknamespace): Likewise.
	(test-xfail-POSIX/wordexp.h/linknamespace): Likewise.
	(test-xfail-UNIX98/fnmatch.h/linknamespace): Likewise.
	(test-xfail-UNIX98/glob.h/linknamespace): Likewise.
	(test-xfail-UNIX98/wordexp.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/fnmatch.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/glob.h/linknamespace): Likewise.
	(test-xfail-XOPEN2K/wordexp.h/linknamespace): Likewise.
This commit is contained in:
Joseph Myers
2015-06-03 13:58:58 +00:00
parent aca6ea6586
commit f014e87eff
4 changed files with 19 additions and 14 deletions

View File

@ -348,7 +348,7 @@ fnmatch (pattern, string, flags)
memset (&ps, '\0', sizeof (ps));
p = pattern;
#ifdef _LIBC
n = strnlen (pattern, 1024);
n = __strnlen (pattern, 1024);
#else
n = strlen (pattern);
#endif
@ -392,7 +392,7 @@ fnmatch (pattern, string, flags)
assert (mbsinit (&ps));
#ifdef _LIBC
n = strnlen (string, 1024);
n = __strnlen (string, 1024);
#else
n = strlen (string);
#endif