-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
From https://github.com/google/oss-fuzz/tree/master/projects/markdown-it-py, fixes issues 55363 and 55367
- Loading branch information
1 parent
34876b1
commit 07e9b7d
Showing
5 changed files
with
41 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
""" | ||
These tests are in response to reports from: | ||
https://github.com/google/oss-fuzz/tree/master/projects/markdown-it-py | ||
In the future, perhaps atheris could be directly used here, | ||
but it was not directly apparent how to integrate it into pytest. | ||
""" | ||
import pytest | ||
|
||
from markdown_it import MarkdownIt | ||
|
||
TESTS = { | ||
55363: ">```\n>", | ||
55367: ">-\n>\n>", | ||
# 55371: "[](so禄0;!" TODO this did not fail | ||
# 55401: "?c_" * 100_000 TODO this did not fail | ||
} | ||
|
||
|
||
@pytest.mark.parametrize("raw_input", TESTS.values(), ids=TESTS.keys()) | ||
def test_fuzzing(raw_input): | ||
md = MarkdownIt() | ||
md.parse(raw_input) | ||
print(md.render(raw_input)) |