From 1f3595b71a0bc1f032a89cb05bfc63999046bca1 Mon Sep 17 00:00:00 2001 From: doug <> Date: Mon, 20 Jul 2015 23:15:28 +0000 Subject: Correct #if/else logic in BIO's dgram_ctrl. Coverity issue 72741 noticed that ret is being overwritten before use. The actual issue is that the #if/else logic is guarding the wrong lines. Besides impacting ret, this also made the case's break logic wrong because it was in the wrong location. ok bcook@ beck@ --- src/lib/libcrypto/bio/bss_dgram.c | 6 +++--- src/lib/libssl/src/crypto/bio/bss_dgram.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/libcrypto/bio/bss_dgram.c b/src/lib/libcrypto/bio/bss_dgram.c index a07834b62c..a9657402ce 100644 --- a/src/lib/libcrypto/bio/bss_dgram.c +++ b/src/lib/libcrypto/bio/bss_dgram.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_dgram.c,v 1.40 2015/02/09 10:55:33 jsing Exp $ */ +/* $OpenBSD: bss_dgram.c,v 1.41 2015/07/20 23:15:28 doug Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -423,10 +423,10 @@ dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ret = -1; break; } - ret = -1; #else - break; + ret = -1; #endif + break; case BIO_CTRL_DGRAM_QUERY_MTU: #if defined(IP_MTU) addr_len = (socklen_t)sizeof(addr); diff --git a/src/lib/libssl/src/crypto/bio/bss_dgram.c b/src/lib/libssl/src/crypto/bio/bss_dgram.c index a07834b62c..a9657402ce 100644 --- a/src/lib/libssl/src/crypto/bio/bss_dgram.c +++ b/src/lib/libssl/src/crypto/bio/bss_dgram.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_dgram.c,v 1.40 2015/02/09 10:55:33 jsing Exp $ */ +/* $OpenBSD: bss_dgram.c,v 1.41 2015/07/20 23:15:28 doug Exp $ */ /* * DTLS implementation written by Nagendra Modadugu * (nagendra@cs.stanford.edu) for the OpenSSL project 2005. @@ -423,10 +423,10 @@ dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ret = -1; break; } - ret = -1; #else - break; + ret = -1; #endif + break; case BIO_CTRL_DGRAM_QUERY_MTU: #if defined(IP_MTU) addr_len = (socklen_t)sizeof(addr); -- cgit v1.2.3-55-g6feb