|
Message-ID: <77f18b20-f3fc-7b07-42e8-8fa013e52ec9@gmail.com> Date: Fri, 26 Feb 2021 12:36:19 -0500 From: Dominic Chen <d.c.ddcc@...il.com> To: musl@...ts.openwall.com Subject: fdopen() doesn't check for valid fd I've been verifying the behavior of an application between glibc and musl, and have noticed that the musl implementation of fdopen() assumes that the input fd is valid, whereas glibc does not. Per https://pubs.opengroup.org/onlinepubs/9699919799/, it seems that fdopen() is allowed to fail with EBADF, so inside __fdopen(), the syscalls to SYS_fcntl and SYS_ioctl should probably check for an error, deallocate the FILE *, and return nullptr. Thanks, Dominic
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.