浏览代码

Add missing parameter check

Mark 7 年之前
父节点
当前提交
32d6a02f3b
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/ua_securechannel.c

+ 4 - 0
src/ua_securechannel.c

@@ -130,6 +130,10 @@ UA_SecureChannel_generateNonce(const UA_SecureChannel *const channel,
 
 UA_StatusCode
 UA_SecureChannel_generateNewKeys(UA_SecureChannel *const channel) {
+
+    if(channel == NULL)
+        return UA_STATUSCODE_BADINTERNALERROR;
+
     const UA_SecurityPolicy *const securityPolicy = channel->securityPolicy;
     const UA_SecurityPolicyChannelModule *channelModule =
         &securityPolicy->channelModule;