aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/node
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-10-02 10:23:20 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-10-02 10:23:20 -0700
commit86ef17ada9a11966ea307c720bfa06e63ce09184 (patch)
tree2ba79e346c8c4ae6b7392c6e666e67e1b1409f1e /src/node
parent5f709ca2a43e63c0fc069112b53acb2f84211ff0 (diff)
Prevented composing insecure credentials
Diffstat (limited to 'src/node')
-rw-r--r--src/node/ext/channel_credentials.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/node/ext/channel_credentials.cc b/src/node/ext/channel_credentials.cc
index 07763bd301..3d47ff293d 100644
--- a/src/node/ext/channel_credentials.cc
+++ b/src/node/ext/channel_credentials.cc
@@ -181,6 +181,10 @@ NAN_METHOD(ChannelCredentials::Compose) {
}
ChannelCredentials *self = ObjectWrap::Unwrap<ChannelCredentials>(
info.This());
+ if (self->wrapped_credentials == NULL) {
+ return Nan::ThrowTypeError(
+ "Cannot compose insecure credential");
+ }
CallCredentials *other = ObjectWrap::Unwrap<CallCredentials>(
Nan::To<Object>(info[0]).ToLocalChecked());
grpc_credentials *creds = grpc_composite_credentials_create(