Explorar o código

Add missing parameter check

Mark %!s(int64=7) %!d(string=hai) anos
pai
achega
32d6a02f3b
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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;