about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--stdio-common/vfprintf.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 772a66487b..b4d30e40a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-07-06  Ulrich Drepper  <drepper@redhat.com>
 
+	* stdio-common/vfprintf.c (process_string_arg): Check result of
+	wcrtomb call and bail out if it failed.
+
 	* malloc/Makefile (test-srcs): Add tst-mtrace.
 	(distribute): Add tst-mtrace.sh.
 	Add rule to run tst-mtrace.sh.
@@ -15,7 +18,7 @@
 	* sysdeps/unix/sysv/linux/sparc/sparc32/sigaction.c: Likewise.
 	* sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c: Likewise.
 
-	* configure.in: Fix CLAGS-memprofstat.c definition after
+	* configure.in: Fix CFLAGS-memprofstat.c definition after
 	2000-06-19 change.
 	Patch by Bradford W. Johnson <bradford@math.umn.edu>.
 
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index 0f35de6644..32ad9d85ab 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -1096,6 +1096,12 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
 	len = __wcrtomb (buf, (fspec == NULL ? va_arg (ap, wint_t)	      \
 			       : args_value[fspec->data_arg].pa_wchar),	      \
 			 &mbstate);					      \
+	if (len == (size_t) -1)						      \
+	  {								      \
+	    /* Something went wron gduring the conversion.  Bail out.  */     \
+	    done = -1;							      \
+	    goto all_done;						      \
+	  }								      \
 	width -= len;							      \
 	if (!left)							      \
 	  PAD (' ');							      \