summaryrefslogtreecommitdiffstats
path: root/lib/libutil/_secure_path.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2003-05-31 05:20:44 +0000
committerru <ru@FreeBSD.org>2003-05-31 05:20:44 +0000
commit1c938f7a9e304a2c64368e6fb3cff2d83bd4d9a4 (patch)
treee0e71cfdb412ddb91a5b4f78462d1919fe9cb5cf /lib/libutil/_secure_path.c
parent06641851f8ab25e4c5ca45bf053705ec5e66d5a4 (diff)
downloadFreeBSD-src-1c938f7a9e304a2c64368e6fb3cff2d83bd4d9a4.zip
FreeBSD-src-1c938f7a9e304a2c64368e6fb3cff2d83bd4d9a4.tar.gz
If an application closes one of its stdio descriptors (0..2),
an excessive close() on one of these descriptors would cause a memory for this descriptor to be allocated in the internal descriptor table. When this descriptor gets used again, e.g. through the call to open() or socket(), the descriptor would be erroneously left in the blocking mode, and the whole application would get stuck on a blocking operation, e.g., in accept(2). Prevent this bug from happening by disallowing close() against non-active descriptors (return -1 and set errno to EBADF in this case). Reviewed by: deischen Approved by: re (scottl)
Diffstat (limited to 'lib/libutil/_secure_path.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud