diff options
| author | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:52:01 +0300 |
|---|---|---|
| committer | Mehmet Samet Duman <yongdohyun@projecttick.org> | 2026-04-02 18:52:01 +0300 |
| commit | 9abbaae5b59443f7c714ffaed3d03a87e79455ad (patch) | |
| tree | 6f9b25e5599b6d813f054a08427e3ae75b2be3e5 /meta/fuzz | |
| parent | d3261e64152397db2dca4d691a990c6bc2a6f4dd (diff) | |
| download | Project-Tick-9abbaae5b59443f7c714ffaed3d03a87e79455ad.tar.gz Project-Tick-9abbaae5b59443f7c714ffaed3d03a87e79455ad.zip | |
NOISSUE updated meta with Project Tick patches
Signed-off-by: Mehmet Samet Duman <yongdohyun@projecttick.org>
Diffstat (limited to 'meta/fuzz')
| -rw-r--r-- | meta/fuzz/meta/fuzz_meta_models.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta/fuzz/meta/fuzz_meta_models.py b/meta/fuzz/meta/fuzz_meta_models.py new file mode 100644 index 0000000000..c443a9a538 --- /dev/null +++ b/meta/fuzz/meta/fuzz_meta_models.py @@ -0,0 +1,45 @@ +import json +import os +import sys + +import atheris + +REPO_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) +if REPO_ROOT not in sys.path: + sys.path.insert(0, REPO_ROOT) + +from meta.model import MetaPackage, MetaVersion # noqa: E402 + + +def test_one_input(data: bytes) -> None: + try: + text = data.decode("utf-8", errors="ignore") + except Exception: + return + + if not text: + return + + try: + json.loads(text) + except Exception: + return + + try: + MetaPackage.parse_raw(text) + except Exception: + pass + + try: + MetaVersion.parse_raw(text) + except Exception: + pass + + +def main() -> None: + atheris.Setup(sys.argv, test_one_input) + atheris.Fuzz() + + +if __name__ == "__main__": + main() |
