about summary refs log tree commit diff
path: root/stdio-common/vfprintf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-07 06:05:09 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-07 06:05:09 +0000
commitca4447d63456122e0f046379351f8ff2e2ddc549 (patch)
treef0033dfe844beeecda319f1012a1584f27d1f23e /stdio-common/vfprintf.c
parent199d6eb060b474ad81bf24dd9ae53d99d5646b9d (diff)
downloadglibc-ca4447d63456122e0f046379351f8ff2e2ddc549.tar.gz
glibc-ca4447d63456122e0f046379351f8ff2e2ddc549.tar.xz
glibc-ca4447d63456122e0f046379351f8ff2e2ddc549.zip
Update.
	* stdio-common/vfprintf.c (process_string_arg): Check result of
	wcrtomb call and bail out if it failed.

	* configure.in: Fix CFLAGS-memprofstat.c definition after
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r--stdio-common/vfprintf.c6
1 files changed, 6 insertions, 0 deletions
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 (' ');							      \