Explorar el Código

Add missing parameter check

Mark hace 7 años
padre
commit
32d6a02f3b
Se han modificado 1 ficheros con 4 adiciones y 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;