summaryrefslogtreecommitdiff
path: root/src/transports
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2014-10-13 13:34:15 -0400
committerEdward Thomson <ethomson@microsoft.com>2014-10-26 22:13:40 -0400
commit369b0217330383925d8091ae01079789cde80598 (patch)
treee3c14a87d6b43bf0a589ce8cd6dba09501040a7c /src/transports
parent70f7e2c6e3fc908dd6a4e027dc43d5ce5be94d75 (diff)
downloadlibgit2-369b0217330383925d8091ae01079789cde80598.tar.gz
Clean up various compiler warnings
Diffstat (limited to 'src/transports')
-rw-r--r--src/transports/http.c7
-rw-r--r--src/transports/ssh.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/src/transports/http.c b/src/transports/http.c
index bcfeaee7f..4070b683a 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -552,7 +552,7 @@ static int http_connect(http_subtransport *t)
#ifdef GIT_SSL
if ((!error || error == GIT_ECERTIFICATE) && t->owner->certificate_check_cb != NULL) {
X509 *cert = SSL_get_peer_certificate(t->socket.ssl.ssl);
- git_cert_x509 cert_info;
+ git_cert_x509 cert_info, *cert_info_ptr;
int len, is_valid;
unsigned char *guard, *encoded_cert;
@@ -581,7 +581,10 @@ static int http_connect(http_subtransport *t)
cert_info.cert_type = GIT_CERT_X509;
cert_info.data = encoded_cert;
cert_info.len = len;
- error = t->owner->certificate_check_cb((git_cert *) &cert_info, is_valid, t->connection_data.host, t->owner->message_cb_payload);
+
+ cert_info_ptr = &cert_info;
+
+ error = t->owner->certificate_check_cb((git_cert *) cert_info_ptr, is_valid, t->connection_data.host, t->owner->message_cb_payload);
git__free(encoded_cert);
if (error < 0) {
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index 3868a529a..39e4e3d15 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -480,7 +480,7 @@ static int _git_ssh_setup_conn(
goto on_error;
if (t->owner->certificate_check_cb != NULL) {
- git_cert_hostkey cert = { 0 };
+ git_cert_hostkey cert = { 0 }, *cert_ptr;
const char *key;
cert.cert_type = GIT_CERT_HOSTKEY_LIBSSH2;
@@ -504,7 +504,10 @@ static int _git_ssh_setup_conn(
/* We don't currently trust any hostkeys */
giterr_clear();
- error = t->owner->certificate_check_cb((git_cert *) &cert, 0, host, t->owner->message_cb_payload);
+
+ cert_ptr = &cert;
+
+ error = t->owner->certificate_check_cb((git_cert *) cert_ptr, 0, host, t->owner->message_cb_payload);
if (error < 0) {
if (!giterr_last())
giterr_set(GITERR_NET, "user cancelled hostkey check");