We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3525b4 commit b480757Copy full SHA for b480757
pyproject.toml
@@ -53,6 +53,9 @@ doc = [
53
benchmarks = [
54
"pytest-benchmark==4.0.0",
55
]
56
+fuzz = [
57
+ "atheris",
58
+]
59
60
[tool.setuptools.packages.find]
61
include = ["cbor2"]
tests/fuzzers/loads_fuzzer.py
@@ -0,0 +1,19 @@
1
+import sys
2
+
3
+import atheris
4
5
+# _cbor2 ensures the C library is imported
6
+from _cbor2 import loads
7
8
9
+def test_one_input(data: bytes):
10
+ try:
11
+ loads(data)
12
+ except Exception:
13
+ # We're searching for memory corruption, not Python exceptions
14
+ pass
15
16
17
+if __name__ == "__main__":
18
+ atheris.Setup(sys.argv, test_one_input)
19
+ atheris.Fuzz()
0 commit comments