mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
libio: Remove codecvt vtable [BZ #24588]
The codecvt vtable is not a real vtable because it also contains the conversion state data. Furthermore, wide stream support was added to GCC 3.0, after a C++ ABI bump, so there is no compatibility requirement with libstdc++. This change removes several unmangled function pointers which could be used with a corrupted FILE object to redirect execution. (libio vtable verification did not cover the codecvt vtable.) Reviewed-by: Yann Droneaud <ydroneaud@opteya.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
@ -58,8 +58,7 @@ _IO_new_fsetpos (FILE *fp, const __fpos_t *posp)
|
||||
else
|
||||
{
|
||||
result = 0;
|
||||
if (fp->_mode > 0
|
||||
&& (*fp->_codecvt->__codecvt_do_encoding) (fp->_codecvt) < 0)
|
||||
if (fp->_mode > 0 && __libio_codecvt_encoding (fp->_codecvt) < 0)
|
||||
/* This is a stateful encoding, restore the state. */
|
||||
fp->_wide_data->_IO_state = posp->__state;
|
||||
}
|
||||
|
Reference in New Issue
Block a user