From 8b0a52444c889fd368f51ba37ad401b6ca5d40f1 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 22 Aug 2005 07:34:59 +0000 Subject: Updated to fedora-glibc-20050822T0727 --- debug/tst-chk1.c | 36 ++++++++++++++++++++++++++++++++++++ debug/vfprintf_chk.c | 3 ++- 2 files changed, 38 insertions(+), 1 deletion(-) (limited to 'debug') diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c index c22c2e8fc2..8940e880e6 100644 --- a/debug/tst-chk1.c +++ b/debug/tst-chk1.c @@ -1107,6 +1107,24 @@ do_test (void) CHK_FAIL_END #endif + cp = "A"; + if (mbstowcs (wenough, cp, 10) != 1) + { + puts ("first mbstowcs test failed"); + ret = 1; + } + +#if __USE_FORTIFY_LEVEL >= 1 + /* We know the wchar_t encoding is ISO 10646. So pick a + character which has a multibyte representation which does not + fit. */ + CHK_FAIL_START + wchar_t wsmallbuf[2]; + cp = "ABC"; + mbstowcs (wsmallbuf, cp, 10); + CHK_FAIL_END +#endif + memset (&s, '\0', sizeof (s)); cp = "A"; if (mbsnrtowcs (wenough, &cp, 1, 10, &s) != 1) @@ -1145,6 +1163,24 @@ do_test (void) CHK_FAIL_END #endif + wcp = L"A"; + if (wcstombs (enough, wcp, 10) != 1) + { + puts ("first wcstombs test failed"); + ret = 1; + } + +#if __USE_FORTIFY_LEVEL >= 1 + /* We know the wchar_t encoding is ISO 10646. So pick a + character which has a multibyte representation which does not + fit. */ + CHK_FAIL_START + char smallbuf[2]; + wcp = L"ABC"; + wcstombs (smallbuf, wcp, 10); + CHK_FAIL_END +#endif + memset (&s, '\0', sizeof (s)); wcp = L"A"; if (wcsnrtombs (enough, &wcp, 1, 10, &s) != 1) diff --git a/debug/vfprintf_chk.c b/debug/vfprintf_chk.c index c8e7c3bf3f..10dde3cb1e 100644 --- a/debug/vfprintf_chk.c +++ b/debug/vfprintf_chk.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004 +/* Copyright (C) 1991, 1995, 1996, 1997, 2001, 2004, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -40,3 +40,4 @@ __vfprintf_chk (FILE *fp, int flag, const char *format, va_list ap) return done; } +libc_hidden_def (__vfprintf_chk) -- cgit v1.2.3