summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_rsa.c
diff options
context:
space:
mode:
authorTodd Short <tshort@akamai.com>2017-05-03 10:26:17 -0400
committerRichard Levitte <levitte@openssl.org>2017-05-04 05:37:30 +0200
commit1608d658af4163d2096cb469705d4ba96067877b (patch)
tree2d0da8b573302ba353aaf901f8c94da3b12d33a4 /ssl/ssl_rsa.c
parent37192a92d744f8e15e46a2bac3019582fdafd2ba (diff)
Fix clang compile time error
|version| "could" be used uninitialized here, not really, but the compiler doesn't understand the flow Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3373)
Diffstat (limited to 'ssl/ssl_rsa.c')
-rw-r--r--ssl/ssl_rsa.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c
index f0a058e4bc..c3f27161f4 100644
--- a/ssl/ssl_rsa.c
+++ b/ssl/ssl_rsa.c
@@ -8,6 +8,7 @@
*/
#include <stdio.h>
+#include <assert.h>
#include "ssl_locl.h"
#include "packet_locl.h"
#include <openssl/bio.h>
@@ -903,7 +904,7 @@ int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file)
int ret = 0;
BIO *bin = NULL;
size_t num_extensions = 0, contextoff = 0;
- unsigned int version;
+ unsigned int version = 0;
if (ctx == NULL || file == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO_FILE, ERR_R_PASSED_NULL_PARAMETER);
@@ -1009,8 +1010,10 @@ int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file)
extension = NULL;
}
- ret = SSL_CTX_use_serverinfo_ex(ctx, version, serverinfo,
- serverinfo_length);
+ assert(version != 0);
+ if (version != 0)
+ ret = SSL_CTX_use_serverinfo_ex(ctx, version, serverinfo,
+ serverinfo_length);
end:
/* SSL_CTX_use_serverinfo makes a local copy of the serverinfo. */
OPENSSL_free(name);