From 389d59ba3dbe29e3c1d65269b07017f1ff52826a Mon Sep 17 00:00:00 2001 From: elianalf <62831776+elianalf@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:04:12 +0200 Subject: [PATCH] Refs #20732: Change xml loading method to avoid copy to a file in fuzz_XMLProfiles Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com> --- fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx b/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx index c475e238af1..4d6708acc55 100644 --- a/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx +++ b/fuzz/C++/fuzz_XMLProfiles/fuzz_XMLProfiles.cxx @@ -1,5 +1,5 @@ #include -#include +#include #include "fuzz_utils.h" @@ -23,18 +23,7 @@ extern "C" int LLVMFuzzerTestOneInput( return EXIT_FAILURE; } - const char* filename = buf_to_file(data, size); - - if (filename == NULL) - { - return EXIT_FAILURE; - } - - // TODO change this to a func. taking buf + len (or C string) - // to avoid using `buf_to_file` - xmlparser::XMLProfileManager::loadXMLFile(filename); - - if (delete_file(filename) != 0) + if (ReturnCode_t::RETCODE_OK != fastdds::dds::DomainParticipantFactory::get_instance()->load_XML_profiles_string(reinterpret_cast(data), size)) { return EXIT_FAILURE; }