Detect malformed closing tags as errors in ApacheConfLexer#1656
Merged
Anteru merged 1 commit intopygments:masterfrom Jan 6, 2021
catatonicprime:fix-close-tags
Merged
Detect malformed closing tags as errors in ApacheConfLexer#1656Anteru merged 1 commit intopygments:masterfrom catatonicprime:fix-close-tags
Anteru merged 1 commit intopygments:masterfrom
catatonicprime:fix-close-tags
Conversation
Collaborator
|
Merged, thanks! |
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.
Discovered this issue while fuzzing a parser I've been working on. When a scoped directive's closing tag is malformed with whitespace/newlines prior to the '>' this will generate an error during httpd's config test.
e.g.
or
Will cause this error:
This patch aligns the token stream to more accurately detect this error. I identify open tags vs. closing tags by the absence or presence of the '/' after the '<', respectively. The opening tags should maintain all previous functionality. The closing tags will now be restricted to non-whitespace characters within.
I've included a positive test and negative test related to this specific issue. The negative test (test_malformed_scoped_directive_closing_tag) token stream was derived after the patches. The positive test (test_normal_scoped_directive) is present to ensure expected functionality is maintained.