From b2ac3849b78b175da4f034d93d48e1c8745aadb3 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 22 Mar 2017 13:50:11 +0100 Subject: [PATCH] Fxies for two NetBSD compiler warnings ubkey-pinning.c -o pubkey-pinning.lo ./pubkey-pinning.c: In function '_getdns_verify_pinset_match': ./pubkey-pinning.c:385: warning: 'prev' may be used uninitialized in this function IX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c ./context.c -o context.lo ./context.c: In function '_getdns_upstream_shutdown': ./context.c:760: warning: comparison between signed and unsigned --- src/context.c | 2 +- src/pubkey-pinning.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/context.c b/src/context.c index 1515f77b..41e7d3b2 100644 --- a/src/context.c +++ b/src/context.c @@ -756,7 +756,7 @@ _getdns_upstream_shutdown(getdns_upstream *upstream) uint16_t conn_retries = upstream->upstreams->tls_connection_retries; /* [TLS1]TODO: This arbitrary logic at the moment - review and improve!*/ if (upstream->conn_setup_failed >= conn_retries - || (upstream->conn_shutdowns >= conn_retries*GETDNS_TRANSPORT_FAIL_MULT + || ((int)upstream->conn_shutdowns >= conn_retries*GETDNS_TRANSPORT_FAIL_MULT && upstream->total_responses == 0) || (upstream->conn_completed >= conn_retries && upstream->total_responses == 0 && diff --git a/src/pubkey-pinning.c b/src/pubkey-pinning.c index 89ba5d86..a960ab66 100644 --- a/src/pubkey-pinning.c +++ b/src/pubkey-pinning.c @@ -382,7 +382,7 @@ _getdns_verify_pinset_match(const sha256_pin_t *pinset, X509_STORE_CTX *store) { getdns_return_t ret = GETDNS_RETURN_GENERIC_ERROR; - X509 *x, *prev; + X509 *x, *prev = NULL; int i, len; unsigned char raw[4096]; unsigned char *next;