Browse Source

fixing a memory problem in completeMessage, relies to #689

Stasik0 8 years ago
parent
commit
fc4e8a81cc
2 changed files with 1 additions and 2 deletions
  1. 0 1
      CMakeLists.txt
  2. 1 1
      src/ua_connection.c

+ 0 - 1
CMakeLists.txt

@@ -79,7 +79,6 @@ option(UA_BUILD_EXAMPLES_NODESET_COMPILER "Generate an OPC UA information model
 
 # Advanced Build Targets
 option(UA_BUILD_SELFSIGNED_CERTIFICATE "Generate self-signed certificate" OFF)
-mark_as_advanced(UA_BUILD_SELFSIGNED_CERTIFICATE)
 
 # Building shared libs (dll, so). This option is written into ua_config.h.
 set(UA_DYNAMIC_LINKING OFF)

+ 1 - 1
src/ua_connection.c

@@ -43,7 +43,7 @@ UA_Connection_completeMessages(UA_Connection *connection, UA_ByteString * UA_RES
             retval = UA_STATUSCODE_BADOUTOFMEMORY;
             goto cleanup;
         }
-        memcpy(&data[connection->incompleteMessage.length], message->data, length);
+        memcpy(&data[connection->incompleteMessage.length], message->data, message->length);
         connection->releaseRecvBuffer(connection, message);
         message->data = data;
         message->length += length;