summaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-08-22 07:34:59 +0000
committerJakub Jelinek <jakub@redhat.com>2005-08-22 07:34:59 +0000
commit8b0a52444c889fd368f51ba37ad401b6ca5d40f1 (patch)
treee61c0a96c4f02a2ae41a4a6b8b291cd0adfa75be /debug
parent964f44e4d838ce28ae848f228c7212cf609ace3c (diff)
Updated to fedora-glibc-20050822T0727
Diffstat (limited to 'debug')
-rw-r--r--debug/tst-chk1.c36
-rw-r--r--debug/vfprintf_chk.c3
2 files changed, 38 insertions, 1 deletions
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)