diff options
author | Ondrej Bilka <neleai@seznam.cz> | 2013-05-24 08:34:10 +0200 |
---|---|---|
committer | Ondrej Bilka <neleai@seznam.cz> | 2013-05-24 08:34:10 +0200 |
commit | bae143d2702e5ca1265c55b06072afba01bfc07a (patch) | |
tree | 6c46604eb6e68b48cc0b767d37bfc0034867d0bf /libio | |
parent | d4ea44a04b931ead64788f61a65697b8cd158b81 (diff) | |
download | glibc-bae143d2702e5ca1265c55b06072afba01bfc07a.zip glibc-bae143d2702e5ca1265c55b06072afba01bfc07a.tar.gz glibc-bae143d2702e5ca1265c55b06072afba01bfc07a.tar.bz2 |
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.
Diffstat (limited to 'libio')
-rw-r--r-- | libio/genops.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; } |