Procházet zdrojové kódy

fix an issue for calcsize of extensionobjects

Julius Pfrommer před 8 roky
rodič
revize
86423def87
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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);