summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-08-05 14:23:29 -0400
committerGitHub <noreply@github.com>2016-08-05 14:23:29 -0400
commit56bbdf9349c31d6d326e4d754760549aa85bb425 (patch)
tree64cc5f1ba87bcf73ad9288a61a26b21b9198fada
parentc550c9222830cd39b41d08479c797342a7e6915b (diff)
parent9884dd613ede9946c512803c4caf438eb10e2d36 (diff)
downloadlibgit2-56bbdf9349c31d6d326e4d754760549aa85bb425.tar.gz
Merge pull request #3886 from libgit2/cmn/copypeertrust-null
SecureTransport: handle NULL trust on success
-rw-r--r--src/stransport_stream.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/stransport_stream.c b/src/stransport_stream.c
index 66be58a21..008bdfb3c 100644
--- a/src/stransport_stream.c
+++ b/src/stransport_stream.c
@@ -67,6 +67,9 @@ int stransport_connect(git_stream *stream)
if ((ret = SSLCopyPeerTrust(st->ctx, &trust)) != noErr)
goto on_error;
+ if (!trust)
+ return GIT_ECERTIFICATE;
+
if ((ret = SecTrustEvaluate(trust, &sec_res)) != noErr)
goto on_error;