Skip to content
Commit 3e4a0187 authored by Aaron Merey's avatar Aaron Merey
Browse files

Test fclose on an unopened file.



Add new file libio/tst-fclosed-unopened.c that tests whether fclose on
an unopened file returns EOF.

Calling fclose on unopened files normally causes a use-after-free bug,
however the standard streams are an exception since they are not
deallocated by fclose.

fclose returning EOF for unopened files is not part of the external
contract but there are dependancies on this behaviour.  For example,
gnulib's close_stdout in lib/closeout.c.

Tested for x86_64.

Signed-off-by: default avatarAaron Merey <amerey@redhat.com>
parent 9c0d6f7a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment