-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++: Clean up the XXE query QL. #9176
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
Conversation
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
Local performance is about the same as before. |
DCA looks fine as well. |
MathiasVP
previously approved these changes
May 17, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I've got one single comment that you can choose to address or disagree with :)
MathiasVP
approved these changes
May 17, 2022
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.
This is the promised follow-up PR to clean up the somewhat messy XXE query code, with a unifying
XmlLibrary
class defining sources and sinks. Then split the QL for the query into four files:XXE.ql
, containing the query itself, now a straightforward dataflow query.XXE.qll
, containing the abstract classes / models used by the query.Xerces.qll
, containing the implementation details for all four supported Xerces interfaces.libxml2.qll
, containing the implementation details for the libxml2 library.This makes the code considerably easier to read, navigate, and potentially extend. There are a few limitations as things stand though:
Xerces.qll
into the individual interfaces. Its easily the largest of the four files and it would be logical to break it up, but there's a fair bit of crossover between the interfaces that might make it tricky to do so.XXEFlowStateTransformer
class intoXmlLibrary
. Again it would be logical, but the crossover between the Xerces interfaces that might make this more difficult than it seems.XML.qll
library general purpose. It resides in the query directory. I can imagine a future where we have anXML
library inmodels
, and such a thing could grow from what we have here, but right now what it offers is quite specialized to the needs of the XXE query in particular.There should be no changes to query results from this PR.
I'll check performance locally and with another DCA run.