From 86ef17ada9a11966ea307c720bfa06e63ce09184 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Fri, 2 Oct 2015 10:23:20 -0700 Subject: [PATCH] Prevented composing insecure credentials --- src/node/ext/channel_credentials.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/node/ext/channel_credentials.cc b/src/node/ext/channel_credentials.cc index 07763bd301d..3d47ff293df 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( info.This()); + if (self->wrapped_credentials == NULL) { + return Nan::ThrowTypeError( + "Cannot compose insecure credential"); + } CallCredentials *other = ObjectWrap::Unwrap( Nan::To(info[0]).ToLocalChecked()); grpc_credentials *creds = grpc_composite_credentials_create(