From bae143d2702e5ca1265c55b06072afba01bfc07a Mon Sep 17 00:00:00 2001 From: Ondrej Bilka Date: Fri, 24 May 2013 08:34:10 +0200 Subject: Initialize wide struct info. Fixes 15381. Using wide character function is on byte oriented memstream is undefined behaviour. This behaviour was masked by not initializing wide struct info. We now initialize it to cause a predictable crash. --- libio/genops.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libio') diff --git a/libio/genops.c b/libio/genops.c index 390d8d2..e5c5d5c 100644 --- a/libio/genops.c +++ b/libio/genops.c @@ -661,6 +661,10 @@ _IO_no_init (fp, flags, orientation, wd, jmp) fp->_wide_data->_wide_vtable = jmp; } + else + /* Cause predictable crash when a wide function is called on a byte + stream. */ + fp->_wide_data = (struct _IO_wide_data *) -1L; #endif fp->_freeres_list = NULL; } -- cgit v1.1