summaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
authorOndrej Bilka <neleai@seznam.cz>2013-05-24 08:34:10 +0200
committerOndrej Bilka <neleai@seznam.cz>2013-05-24 08:34:10 +0200
commitbae143d2702e5ca1265c55b06072afba01bfc07a (patch)
tree6c46604eb6e68b48cc0b767d37bfc0034867d0bf /libio
parentd4ea44a04b931ead64788f61a65697b8cd158b81 (diff)
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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libio/genops.c b/libio/genops.c
index 390d8d24b5..e5c5d5cafe 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;
}