[PATCH] libio: freopen of default streams crashes in old programs [BZ #24632]

Florian Weimer fweimer@redhat.com
Wed Jun 12 12:48:00 GMT 2019


* Andreas Schwab:

> On Jun 03 2019, Florian Weimer <fweimer@redhat.com> wrote:
>
>> 	[BZ #24632]
>> 	* libio/libioP.h (_IO_JUMPS_FUNC_UPDATE): New macro.
>> 	* libio/freopen.c (freopen): Use it.
>
> Ok.

Thanks.

>> diff --git a/libio/libioP.h b/libio/libioP.h
>> index 66afaa8968..f17c6e68e4 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))

Ah, fixed.

Florian



More information about the Libc-alpha mailing list