Skip to content

Fix oss-fuzz 42193 [13449] #2397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/cpp/rtps/xmlparser/XMLDynamicParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1336,12 +1336,13 @@ p_dynamictypebuilder_t XMLParser::parseXMLMemberDynamicType(
{
if (!isArray)
{
logError(XMLPARSER, "Failed creating " << memberType << ": " << memberName);
logError(XMLPARSER, "Failed creating " << memberType << ": " << (memberName ? memberName : ""));
}
else
{
logError(XMLPARSER, "Failed creating " << memberType << " array: " << memberName);
logError(XMLPARSER, "Failed creating " << memberType << " array: " << (memberName ? memberName : ""));
}
return nullptr;
}

const char* memberTopicKey = p_root->Attribute(KEY);
Expand Down
1 change: 1 addition & 0 deletions test/unittest/xmlparser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/UDP_transport_descriptors_config.xml
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SHM_transport_descriptors_config.xml
${CMAKE_CURRENT_BINARY_DIR}/SHM_transport_descriptors_config.xml
COPYONLY)
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/regressions" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}")

################################### XMLProfileParserTests ####################################################
set(XMLPROFILEPARSER_SOURCE
Expand Down
1 change: 1 addition & 0 deletions test/unittest/xmlparser/XMLParserTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ TEST_F(XMLParserTests, regressions)
std::unique_ptr<BaseNode> root;

EXPECT_EQ(XMLP_ret::XML_ERROR, XMLParser::loadXML("regressions/12736.xml", root));
EXPECT_EQ(XMLP_ret::XML_ERROR, XMLParser::loadXML("regressions/13418.xml", root));
}

TEST_F(XMLParserTests, NoFile)
Expand Down
1 change: 1 addition & 0 deletions test/unittest/xmlparser/regressions/13418.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<types><type><typedef type=""arrayDimensions=""/></type></types>