Explorar el Código

Check for NULL config

Stefan Profanter hace 5 años
padre
commit
47388c9f2e
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      plugins/ua_config_default.c

+ 3 - 0
plugins/ua_config_default.c

@@ -251,6 +251,9 @@ UA_ServerConfig_setMinimalCustomBuffer(UA_ServerConfig *config, UA_UInt16 portNu
                                        const UA_ByteString *certificate,
                                        UA_UInt32 sendBufferSize,
                                        UA_UInt32 recvBufferSize) {
+	if (!config)
+		return UA_STATUSCODE_BADINVALIDARGUMENT;
+
     UA_StatusCode retval = setDefaultConfig(config);
     if(retval != UA_STATUSCODE_GOOD) {
         UA_ServerConfig_clean(config);