mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-22 14:42:40 +01:00
Make sure we never pass a negative value to dup2(...)
This commit is contained in:
parent
148aaa79d5
commit
e56eee50c8
1 changed files with 1 additions and 0 deletions
|
@ -30,6 +30,7 @@
|
|||
|
||||
static bool move_fd(int from, int to)
|
||||
{
|
||||
assert(from >= 0);
|
||||
if (dup2(from, to) == -1)
|
||||
return false;
|
||||
close(from);
|
||||
|
|
Loading…
Add table
Reference in a new issue