Browse Source

Check for NULL config

Stefan Profanter 5 years ago
parent
commit
47388c9f2e
1 changed files with 3 additions and 0 deletions
  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);