Repository navigation
[20732] Fix some leaks in XML DynamicTypes Parser (backport #4717) - #4735
Merged
Merged
Conversation
Contributor
Author
|
Cherry-pick of 8cb447b has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
11 tasks done
* Refs #20732. Add regression test. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLAliasDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLBitsetDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLBitmaskDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLEnumDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLStructDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLUnionDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20372. Return error when `insertDynamicTypeByName` fails. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20372. Fail parsing for empty name attributes. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Move implementation of `DeleteInstance` to source file. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Delete registered dynamic type builders in `XMLProfileManager::DeleteInstance()`. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> (cherry picked from commit 8cb447b) # Conflicts: # include/fastrtps/xmlparser/XMLProfileManager.h # test/unittest/xmlparser/XMLParserTests.cpp
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
MiguelCompany
force-pushed
the
mergify/bp/2.10.x/pr-4717
branch
from
May 7, 2024 12:31
d83b529 to
c124a1a
Compare
MiguelCompany
self-requested a review
May 7, 2024 12:31
Member
|
@richiprosima Please test this |
11 tasks done
Member
|
@Mergifyio backport 2.6.x |
Contributor
Author
โ Backports have been createdDetails
|
Member
|
@richiprosima Please test mac |
Member
|
@richiprosima please test mac |
Member
|
@richiprosima Please test mac |
mergify Bot
added a commit
that referenced
this pull request
May 9, 2024
* Fix some leaks in XML DynamicTypes Parser (#4717) * Refs #20732. Add regression test. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLAliasDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLBitsetDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLBitmaskDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLEnumDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLStructDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLUnionDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20372. Return error when `insertDynamicTypeByName` fails. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20372. Fail parsing for empty name attributes. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Move implementation of `DeleteInstance` to source file. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Delete registered dynamic type builders in `XMLProfileManager::DeleteInstance()`. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> (cherry picked from commit 8cb447b) # Conflicts: # include/fastrtps/xmlparser/XMLProfileManager.h # test/unittest/xmlparser/XMLParserTests.cpp * Fix conflicts Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> Co-authored-by: Miguel Company <miguelcompany@eprosima.com> (cherry picked from commit 04e90a2)
11 tasks done
MiguelCompany
added a commit
that referenced
this pull request
May 14, 2024
* Fix some leaks in XML DynamicTypes Parser (#4717) * Refs #20732. Add regression test. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLAliasDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLBitsetDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLBitmaskDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLEnumDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLStructDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLUnionDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20372. Return error when `insertDynamicTypeByName` fails. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20372. Fail parsing for empty name attributes. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Move implementation of `DeleteInstance` to source file. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Delete registered dynamic type builders in `XMLProfileManager::DeleteInstance()`. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> (cherry picked from commit 8cb447b) # Conflicts: # include/fastrtps/xmlparser/XMLProfileManager.h # test/unittest/xmlparser/XMLParserTests.cpp * Fix conflicts Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> Co-authored-by: Miguel Company <miguelcompany@eprosima.com> (cherry picked from commit 04e90a2)
EduPonz
pushed a commit
that referenced
this pull request
May 20, 2024
* Fix some leaks in XML DynamicTypes Parser (#4717) (#4735) * Fix some leaks in XML DynamicTypes Parser (#4717) * Refs #20732. Add regression test. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLAliasDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLBitsetDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLBitmaskDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLEnumDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLStructDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Fixes on parseXMLUnionDynamicType. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20372. Return error when `insertDynamicTypeByName` fails. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20372. Fail parsing for empty name attributes. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Move implementation of `DeleteInstance` to source file. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #20732. Delete registered dynamic type builders in `XMLProfileManager::DeleteInstance()`. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> (cherry picked from commit 8cb447b) # Conflicts: # include/fastrtps/xmlparser/XMLProfileManager.h # test/unittest/xmlparser/XMLParserTests.cpp * Fix conflicts Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> Co-authored-by: Miguel Company <miguelcompany@eprosima.com> (cherry picked from commit 04e90a2) * Use old log macros Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a regression test with the XML reported from OSS Fuzz, and performs the following two actions on every method parsing and registering a dynamic type:
#. Doing a pre-check on whether a type with the same name is already registered in the profile manager, and perform an early return in that case
#. Tell
DynamicTypeBuilderFactoryto delete the builder when a call toXMLProfileManager::insertDynamicTypeByNamefails.@Mergifyio backport 2.13.x 2.10.x 2.6.x
Contributor Checklist
Commit messages follow the project guidelines.
The code follows the style guidelines of this project.
Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
N/A Any new/modified methods have been properly documented using Doxygen.
N/A Any new configuration API has an equivalent XML API (with the corresponding XSD extension)
Changes are ABI compatible.
Changes are API compatible.
N/A New feature has been added to the
versions.mdfile (if applicable).N/A New feature has been documented/Current behavior is correctly described in the documentation.
Applicable backports have been included in the description.
Reviewer Checklist
This is an automatic backport of pull request #4717 done by [Mergify](https://mergify.com).