Просмотр исходного кода

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
Родитель
Сommit
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);
     }