Skip to content

Commit e56eee5

Browse files
practicalswiftrustyrussell
authored andcommitted
Make sure we never pass a negative value to dup2(...)
1 parent 148aaa7 commit e56eee5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lightningd/subd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
static bool move_fd(int from, int to)
3232
{
33+
assert(from >= 0);
3334
if (dup2(from, to) == -1)
3435
return false;
3536
close(from);

0 commit comments

Comments
 (0)