Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/stdio fix coredump vfwprintf(stderr) reported in cu...
details: https://anonhg.NetBSD.org/src/rev/055a09bebb78
branches: trunk
changeset: 756746:055a09bebb78
user: tnozaki <tnozaki%NetBSD.org@localhost>
date: Sat Jul 31 07:24:52 2010 +0000
description:
fix coredump vfwprintf(stderr) reported in current-user@
rework rev1.9, _FILEEXT_SETUP() doesn't care wcio_data. so initialize it.
diffstat:
lib/libc/stdio/vfwprintf.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (37 lines):
diff -r 07927ad9750e -r 055a09bebb78 lib/libc/stdio/vfwprintf.c
--- a/lib/libc/stdio/vfwprintf.c Sat Jul 31 07:05:32 2010 +0000
+++ b/lib/libc/stdio/vfwprintf.c Sat Jul 31 07:24:52 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfwprintf.c,v 1.18 2009/10/25 20:44:13 christos Exp $ */
+/* $NetBSD: vfwprintf.c,v 1.19 2010/07/31 07:24:52 tnozaki Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -38,7 +38,7 @@
static char sccsid[] = "@(#)vfprintf.c 8.1 (Berkeley) 6/4/93";
__FBSDID("$FreeBSD: src/lib/libc/stdio/vfwprintf.c,v 1.27 2007/01/09 00:28:08 imp Exp $");
#else
-__RCSID("$NetBSD: vfwprintf.c,v 1.18 2009/10/25 20:44:13 christos Exp $");
+__RCSID("$NetBSD: vfwprintf.c,v 1.19 2010/07/31 07:24:52 tnozaki Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -163,6 +163,7 @@
_DIAGASSERT(fmt != NULL);
_FILEEXT_SETUP(&fake, &fakeext);
+ memset(WCIO_GET(fp), 0, sizeof(struct wchar_io_data));
/* copy the important variables */
fake._flags = fp->_flags & ~__SNBF;
@@ -814,8 +815,9 @@
/* optimise fprintf(stderr) (and other unbuffered Unix files) */
if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) &&
- __sfileno(fp) != -1)
+ __sfileno(fp) != -1) {
return (__sbprintf(fp, fmt0, ap));
+ }
fmt = (CHAR_T *)__UNCONST(fmt0);
argtable = NULL;
Home |
Main Index |
Thread Index |
Old Index