-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move OSS-Fuzz target file under tests
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import sys | ||
import atheris | ||
|
||
# _cbor2 ensures the C library is imported | ||
from _cbor2 import loads | ||
|
||
|
||
def test_one_input(data: bytes): | ||
try: | ||
loads(data) | ||
except Exception: | ||
# We're searching for memory corruption, not Python exceptions | ||
pass | ||
|
||
|
||
def main(): | ||
atheris.Setup(sys.argv, test_one_input) | ||
atheris.Fuzz() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |