From 4efa40d7cda4537e42adaa0dbd70097886d2c91c Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Sat, 20 Oct 2018 10:06:07 -0700 Subject: [PATCH] Validate parameters of GRPCChannelConfiguration:initWithHost: --- src/objective-c/GRPCClient/private/GRPCChannelPool.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/objective-c/GRPCClient/private/GRPCChannelPool.m b/src/objective-c/GRPCClient/private/GRPCChannelPool.m index 8e0f6976cf9..80fa9c9151f 100644 --- a/src/objective-c/GRPCClient/private/GRPCChannelPool.m +++ b/src/objective-c/GRPCClient/private/GRPCChannelPool.m @@ -35,6 +35,8 @@ extern const char *kCFStreamVarName; @implementation GRPCChannelConfiguration - (nullable instancetype)initWithHost:(NSString *)host callOptions:(GRPCCallOptions *)callOptions { + NSAssert(host.length, @"Host must not be empty."); + NSAssert(callOptions, @"callOptions must not be empty."); if ((self = [super init])) { _host = [host copy]; _callOptions = [callOptions copy];