Browse Source

Stack: Check for out-of-memory while creating server config

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11646

Credit to oss-fuzz
Stefan Profanter 5 years ago
parent
commit
b07583145f
1 changed files with 3 additions and 0 deletions
  1. 3 0
      plugins/ua_config_default.c

+ 3 - 0
plugins/ua_config_default.c

@@ -256,6 +256,9 @@ UA_ServerConfig_new_customBuffer(UA_UInt16 portNumber,
                                  UA_UInt32 sendBufferSize,
                                  UA_UInt32 recvBufferSize) {
     UA_ServerConfig *conf = createDefaultConfig();
+    if (!conf) {
+        return NULL;
+    }
 
     UA_StatusCode retval = UA_Nodestore_default_new(&conf->nodestore);
     if(retval != UA_STATUSCODE_GOOD) {