From 2d733c424ba21cfa55386e81d668036cc801fc6d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 20 Jan 1999 15:48:22 +0000 Subject: More general fix based on bug report and patch from Ian Lance Taylor to fix this problem: There is a small bug in __rtems_close in c/src/lib/libc/libio.c. It does not check whether the file descriptor it is passed is open. This can cause it to make a null dereference if it is passed a file descriptor which is in the valid range but which was not opened, or which was already closed. --- c/src/exec/libcsupport/src/fdatasync.c | 1 + 1 file changed, 1 insertion(+) (limited to 'c/src/exec/libcsupport/src/fdatasync.c') diff --git a/c/src/exec/libcsupport/src/fdatasync.c b/c/src/exec/libcsupport/src/fdatasync.c index 91bff3aaba..7de28ce38a 100644 --- a/c/src/exec/libcsupport/src/fdatasync.c +++ b/c/src/exec/libcsupport/src/fdatasync.c @@ -24,6 +24,7 @@ int fdatasync( rtems_libio_check_fd( fd ); iop = rtems_libio_iop( fd ); + rtems_libio_check_is_open(iop); rtems_libio_check_permissions( iop, LIBIO_FLAGS_WRITE ); /* -- cgit v1.2.3