diff options
author | Florian Weimer <fweimer@redhat.com> | 2019-06-12 14:48:33 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2019-06-12 14:48:33 +0200 |
commit | cfa611447b44d2fa1cb3d8f853b6f3f75ade366a (patch) | |
tree | 52f89d4d9ddf45959ab478d4701b80e42e66614f /libio/libioP.h | |
parent | 744e829637162bb7d5029632aacf341c64b86990 (diff) | |
download | glibc-cfa611447b44d2fa1cb3d8f853b6f3f75ade366a.tar.gz glibc-cfa611447b44d2fa1cb3d8f853b6f3f75ade366a.tar.xz glibc-cfa611447b44d2fa1cb3d8f853b6f3f75ade366a.zip |
libio: freopen of default streams crashes in old programs [BZ #24632]
As seen with very old i386 GCC binaries.
Diffstat (limited to 'libio/libioP.h')
-rw-r--r-- | libio/libioP.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libio/libioP.h b/libio/libioP.h index 66afaa8968..afa46cc519 100644 --- a/libio/libioP.h +++ b/libio/libioP.h @@ -108,9 +108,14 @@ (IO_validate_vtable \ (*(struct _IO_jump_t **) ((void *) &_IO_JUMPS_FILE_plus (THIS) \ + (THIS)->_vtable_offset))) +# define _IO_JUMPS_FUNC_UPDATE(THIS, VTABLE) \ + (*(const struct _IO_jump_t **) ((void *) &_IO_JUMPS_FILE_plus (THIS) \ + + (THIS)->_vtable_offset) = (VTABLE)) # define _IO_vtable_offset(THIS) (THIS)->_vtable_offset #else # define _IO_JUMPS_FUNC(THIS) (IO_validate_vtable (_IO_JUMPS_FILE_plus (THIS))) +# define _IO_JUMPS_FUNC_UPDATE(THIS, VTABLE) \ + (_IO_JUMPS_FILE_plus (THIS) = (VTABLE)) # define _IO_vtable_offset(THIS) 0 #endif #define _IO_WIDE_JUMPS_FUNC(THIS) _IO_WIDE_JUMPS(THIS) |