|
|
Message-ID: <11940511.InkjXumKWH@omega>
Date: Mon, 25 Jan 2021 09:40:23 +0100
From: Bruno Haible <bruno@...sp.org>
To: musl@...ts.openwall.com
Subject: insufficient checking in posix_spawn_file_actions_addclose
Similarly, POSIX [1] says:
"The posix_spawn_file_actions_addclose() function shall fail if:
[EBADF]
The value specified by fildes is negative."
However, in musl libc 1.2.2, this test program exits with status 2:
========================================================================
#include <spawn.h>
int main ()
{
posix_spawn_file_actions_t actions;
if (posix_spawn_file_actions_init (&actions) != 0)
return 1;
if (posix_spawn_file_actions_addclose (&actions, -5) == 0)
return 2;
return 0;
}
========================================================================
Best regards,
Bruno
[1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn_file_actions_addclose.html
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.