ソースを参照

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;