open62541 / open62541

Open source implementation of OPC UA (OPC Unified Architecture) aka IEC 62541 licensed under Mozilla Public License v2.0
http://open62541.org
Mozilla Public License 2.0
2.6k stars 1.25k forks source link

Uninitialized syncResponse member #6050

Closed sbela closed 1 year ago

sbela commented 1 year ago

Description

In __UA_Client_AsyncServiceEx the AsyncServiceCall missing an init ac->syncResponse = NULL;

Background Information / Reproduction Steps

If I run with MSVC and debug, int the processMSGResponse the UA_Response *response = (ac->syncResponse) ? ac->syncResponse : &asyncResponse; line will eavluate to response = 0xcdcdcdcdcdcdcdcd so it will fail at line UA_free(ac); at the end of the function processMSGResponse .

Used CMake options: I have used: /**

/**

define UA_ARCHITECTURE_WIN32

/ #undef UA_ARCHITECTURE_POSIX /

/ Select default architecture if none is selected /

if !defined(UA_ARCHITECtURE_WIN32) && !defined(UA_ARCHITECtURE_POSIX)

ifdef _WIN32

define UA_ARCHITECTURE_WIN32

else

define UA_ARCHITECTURE_POSIX

endif

endif

/**

define UA_LOGLEVEL 500

ifndef UA_ENABLE_AMALGAMATION

define UA_ENABLE_AMALGAMATION

endif

define UA_ENABLE_METHODCALLS

define UA_ENABLE_NODEMANAGEMENT

define UA_ENABLE_SUBSCRIPTIONS

/ #undef UA_ENABLE_PUBSUB / / #undef UA_ENABLE_PUBSUB_ENCRYPTION / / #undef UA_ENABLE_PUBSUB_FILE_CONFIG / / #undef UA_ENABLE_PUBSUB_ETH_UADP / / #undef UA_ENABLE_PUBSUB_INFORMATIONMODEL /

define UA_ENABLE_DA

define UA_ENABLE_DIAGNOSTICS

define UA_ENABLE_HISTORIZING

define UA_ENABLE_PARSING

define UA_ENABLE_SUBSCRIPTIONS_EVENTS

define UA_ENABLE_JSON_ENCODING

/ #undef UA_ENABLE_XML_ENCODING / / #undef UA_ENABLE_MQTT / / #undef UA_ENABLE_NODESET_INJECTOR / / #undef UA_INFORMATION_MODEL_AUTOLOAD / / #undef UA_ENABLE_ENCRYPTION_MBEDTLS / / #undef UA_ENABLE_CERT_REJECTED_DIR / / #undef UA_ENABLE_TPM2_SECURITY /

define UA_ENABLE_ENCRYPTION_OPENSSL

/ #undef UA_ENABLE_ENCRYPTION_LIBRESSL /

if defined(UA_ENABLE_ENCRYPTION_MBEDTLS) || defined(UA_ENABLE_ENCRYPTION_OPENSSL) || defined(UA_ENABLE_ENCRYPTION_LIBRESSL)

define UA_ENABLE_ENCRYPTION

endif

/ #undef UA_ENABLE_SUBSCRIPTIONS_ALARMS_CONDITIONS /

/ Multithreading / / #undef UA_ENABLE_IMMUTABLE_NODES /

define UA_MULTITHREADING 100

/ Advanced Options /

define UA_ENABLE_STATUSCODE_DESCRIPTIONS

define UA_ENABLE_TYPEDESCRIPTION

/ #undef UA_ENABLE_INLINABLE_EXPORT /

define UA_ENABLE_NODESET_COMPILER_DESCRIPTIONS

/ #undef UA_ENABLE_DETERMINISTIC_RNG /

define UA_ENABLE_DISCOVERY

/ #undef UA_ENABLE_DISCOVERY_MULTICAST / / #undef UA_ENABLE_QUERY / / #undef UA_ENABLE_MALLOC_SINGLETON /

define UA_ENABLE_DISCOVERY_SEMAPHORE

define UA_GENERATED_NAMESPACE_ZERO

/ #undef UA_GENERATED_NAMESPACE_ZERO_FULL / / #undef UA_ENABLE_PUBSUB_MONITORING / / #undef UA_ENABLE_PUBSUB_BUFMALLOC / / #undef UA_ENABLE_PUBSUB_SKS /

/ #undef UA_PACK_DEBIAN /

/ Options for Debugging / / #undef UA_DEBUG / / #undef UA_DEBUG_DUMP_PKGS / / #undef UA_DEBUG_FILE_LINE_INFO /

Checklist

Please provide the following information:

sbela commented 1 year ago

Ok! I made this to myself. I have compiling this against Qt 6.5.3 which needed the __UA_Client_AsyncServiceEx function which was removed some time ago. And I have not read carefully. Sorry!