Skip to content

Commit 5e1e8ca

Browse files
committed
ci: move the fuzz target from OSS-Fuzz
as discussed in google/oss-fuzz#12050
1 parent a1afb9a commit 5e1e8ca

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

scapy/tools/pcap_fuzzer.py

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/python3
2+
3+
# SPDX-License-Identifier: GPL-2.0-only
4+
# This file is part of Scapy
5+
# See https://scapy.net/ for more information
6+
7+
import sys
8+
import atheris
9+
10+
with atheris.instrument_imports():
11+
import io
12+
import scapy
13+
import scapy.error
14+
import scapy.layers.all
15+
import scapy.utils
16+
17+
18+
def TestOneInput(input_bytes):
19+
try:
20+
for p in scapy.utils.rdpcap(io.BytesIO(input_bytes)):
21+
p.summary()
22+
except scapy.error.Scapy_Exception:
23+
pass
24+
25+
26+
def main():
27+
atheris.Setup(sys.argv, TestOneInput)
28+
atheris.Fuzz()
29+
30+
31+
if __name__ == "__main__":
32+
main()

0 commit comments

Comments
 (0)