mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-11 01:54:25 +01:00
Make sure we never pass a negative value to dup2(...)
This commit is contained in:
committed by
Rusty Russell
parent
148aaa79d5
commit
e56eee50c8
@@ -30,6 +30,7 @@
|
||||
|
||||
static bool move_fd(int from, int to)
|
||||
{
|
||||
assert(from >= 0);
|
||||
if (dup2(from, to) == -1)
|
||||
return false;
|
||||
close(from);
|
||||
|
||||
Reference in New Issue
Block a user