From e56eee50c8645f597f53a0c423b0851cfcf74ee7 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Mon, 19 Mar 2018 09:21:45 +0100 Subject: [PATCH] Make sure we never pass a negative value to dup2(...) --- lightningd/subd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lightningd/subd.c b/lightningd/subd.c index 49ad2f47c..770a7acc5 100644 --- a/lightningd/subd.c +++ b/lightningd/subd.c @@ -30,6 +30,7 @@ static bool move_fd(int from, int to) { + assert(from >= 0); if (dup2(from, to) == -1) return false; close(from);