From 027d9601ebbb5c6d8128de0038a7bfe12430b8bf Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Fri, 3 Nov 2017 13:54:07 +0100 Subject: [PATCH] net.c: always initialize bytes_read In CID 1459612, Coverity scan has complained about uninitialized use of the variable bytes_read. Although this is a false positive here, it seems to be more safe to always initialize bytes_read. --- src/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/net.c b/src/net.c index 2085adc4..4b3f6269 100644 --- a/src/net.c +++ b/src/net.c @@ -1099,7 +1099,7 @@ coap_read_session(coap_context_t *ctx, coap_session_t *session, coap_tick_t now) coap_handle_dgram_for_proto(ctx, session, packet); } } else { - ssize_t bytes_read; + ssize_t bytes_read = 0; const uint8_t *p; int retry; /* adjust for LWIP */