aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Muxi Yan <muxi@users.noreply.github.com>2018-10-16 13:35:45 -0700
committerGravatar GitHub <noreply@github.com>2018-10-16 13:35:45 -0700
commit34e2a7be1785b4fc8a90db53dec4cdfc749c9026 (patch)
treed69e6e8dc1a5ef0e53ab2a9ff5af06373298fe12 /src
parent7380707fd37a6812a1b6ce9f4be1aa8e3ebea928 (diff)
parente08c05903a14cc4352259ce284ef09205b0fd5c2 (diff)
Merge pull request #16650 from muxi/fix-analyze-issue
Fix analyze issues in gRPC ObjC lib
Diffstat (limited to 'src')
-rw-r--r--src/objective-c/GRPCClient/private/GRPCHost.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/objective-c/GRPCClient/private/GRPCHost.m b/src/objective-c/GRPCClient/private/GRPCHost.m
index 862909f238..85b95dee91 100644
--- a/src/objective-c/GRPCClient/private/GRPCHost.m
+++ b/src/objective-c/GRPCClient/private/GRPCHost.m
@@ -69,7 +69,7 @@ static NSMutableDictionary *kHostCache;
// gRPC library.
// TODO(jcanizales): Add unit tests for the types of addresses we want to let pass untouched.
NSURL *hostURL = [NSURL URLWithString:[@"https://" stringByAppendingString:address]];
- if (hostURL.host && !hostURL.port) {
+ if (hostURL.host && hostURL.port == nil) {
address = [hostURL.host stringByAppendingString:@":443"];
}
@@ -193,6 +193,7 @@ static NSMutableDictionary *kHostCache;
if (pemPrivateKey == nil && pemCertChain == nil) {
creds = grpc_ssl_credentials_create(rootsASCII.bytes, NULL, NULL, NULL);
} else {
+ assert(pemPrivateKey != nil && pemCertChain != nil);
grpc_ssl_pem_key_cert_pair key_cert_pair;
NSData *privateKeyASCII = [self nullTerminatedDataWithString:pemPrivateKey];
NSData *certChainASCII = [self nullTerminatedDataWithString:pemCertChain];
@@ -226,7 +227,7 @@ static NSMutableDictionary *kHostCache;
args[@GRPC_SSL_TARGET_NAME_OVERRIDE_ARG] = _hostNameOverride;
}
- if (_responseSizeLimitOverride) {
+ if (_responseSizeLimitOverride != nil) {
args[@GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH] = _responseSizeLimitOverride;
}