瀏覽代碼

Fix double free of node id

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

Credit to oss-fuzz
Stefan Profanter 7 年之前
父節點
當前提交
9165b056a9
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/ua_types_encoding_binary.c

+ 1 - 1
src/ua_types_encoding_binary.c

@@ -943,7 +943,7 @@ ExtensionObject_decodeBinaryContent(UA_ExtensionObject *dst, const UA_NodeId *ty
     /* Unknown type, just take the binary content */
     if(!type) {
         dst->encoding = UA_EXTENSIONOBJECT_ENCODED_BYTESTRING;
-        dst->content.encoded.typeId = *typeId;
+        UA_NodeId_copy(typeId, &dst->content.encoded.typeId);
         return ByteString_decodeBinary(&dst->content.encoded.body);
     }