Ver código fonte

fix an issue for calcsize of extensionobjects

Julius Pfrommer 8 anos atrás
pai
commit
86423def87
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      src/ua_types_encoding_binary.c

+ 2 - 1
src/ua_types_encoding_binary.c

@@ -1296,7 +1296,8 @@ ExtensionObject_calcSizeBinary(const UA_ExtensionObject *src, UA_DataType *_) {
             return 0;
         s += NodeId_calcSizeBinary(&src->content.decoded.type->typeId, NULL);
         s += 4; // length
-        size_t encode_index = type->builtin ? type->typeIndex : UA_BUILTIN_TYPES_COUNT;
+        size_t encode_index = src->content.decoded.type->builtin ?
+            src->content.decoded.type->typeIndex : UA_BUILTIN_TYPES_COUNT;
         s += calcSizeBinaryJumpTable[encode_index](src->content.decoded.data, src->content.decoded.type);
     } else {
         s += NodeId_calcSizeBinary(&src->content.encoded.typeId, NULL);