[ccan] [PATCH 0/7] Coverity

2017-04-03 Thread David Gibson
Since Emilio has set up ccan on Coverity Scan, here are some patches making use of it. The first updates our Travis configuration to push builds to Coverity for analysis. The rest fix some of the easier to address bugs that Coverity located. David Gibson (7): .travis.yml: Add support for

[ccan] [PATCH 7/7] net: Add check for failure of setsockopt()

2017-04-03 Thread David Gibson
make_listen_fd() didn't check for failure of setsockopt(). There's no real reason not to, since we have an obvious way to report an error to the caller. Found with Coverity Scan. Signed-off-by: David Gibson --- ccan/net/net.c | 4 +++- 1 file changed, 3

[ccan] [PATCH 6/7] ccanlint: Fix leak in do_reduce_features()

2017-04-03 Thread David Gibson
options_avail and options_used get freed, but options does not. Found by Coverity scan. Signed-off-by: David Gibson --- tools/ccanlint/tests/reduce_features.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/ccanlint/tests/reduce_features.c

[ccan] [PATCH 5/7] crypto/ripemd160: Correct badly sized union member

2017-04-03 Thread David Gibson
struct ripemd160_ctx has a union for converting between u8[] and u32[] data. Unfortunately the u32 array has a miscalculated size, half the size of the u8 array. That means some accesses which are within the union can technically overrun the u32 array. Found by Coverity scan. Signed-off-by:

[ccan] [PATCH 3/7] tools: Remove fd leak

2017-04-03 Thread David Gibson
compile_info() can leak an open file descriptor write_all() fails. This corrects it. Found by Coverity. Signed-off-by: David Gibson --- tools/depends.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/depends.c b/tools/depends.c index

[ccan] [PATCH 2/7] failtest: Remove memory leak

2017-04-03 Thread David Gibson
Somewhat ironically, a path in failtest related to detecting leaks in the tested program itself leaks memory. This corrects it. Detected by Coverity. Signed-off-by: David Gibson --- ccan/failtest/failtest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

Re: [ccan] [PATCH 1/7] .travis.yml: Add support for Coverity Scan

2017-04-03 Thread David Gibson
On Mon, Apr 03, 2017 at 09:11:06PM +1000, David Gibson wrote: > Add support for Travis to upload builds to Coverity Scan. > > Travis encrypted keys are there which should make it work for builds > at either: > https://travis-ci.org/rustyrussell/ccan > or >