Skip to content

Commit dcb3b18

Browse files
authored
python-email-validator: add corpus (#9475)
1 parent 5194616 commit dcb3b18

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

projects/python-email-validator/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
FROM gcr.io/oss-fuzz-base/base-builder-python
1818
RUN apt-get update && apt-get install -y make autoconf automake libtool
19-
RUN git clone --depth 1 https://github.com/JoshData/python-email-validator python-email-validator
19+
RUN git clone --depth 1 https://github.com/JoshData/python-email-validator python-email-validator
20+
RUN git clone --depth 1 https://github.com/manunio/fuzz-corpus fuzz-corpus
2021
WORKDIR python-email-validator
2122
COPY build.sh *.py $SRC/

projects/python-email-validator/build.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#
1616
################################################################################
1717

18+
zip -r $OUT/fuzz_validator_corpus_seed.zip $SRC/fuzz-corpus/python-email-validator
19+
1820
pip3 install .
1921
for fuzzer in $(find $SRC -name 'fuzz_*.py');do
2022
compile_python_fuzzer $fuzzer

projects/python-email-validator/fuzz_validator.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121

2222

2323
def TestOneInput(data):
24-
try:
25-
validate_email(data)
26-
except (EmailSyntaxError, EmailUndeliverableError):
27-
pass
24+
try:
25+
validate_email(data)
26+
except (EmailSyntaxError, EmailUndeliverableError):
27+
pass
2828

2929

3030
def main():
31-
atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)
32-
atheris.instrument_all()
33-
atheris.Fuzz()
31+
atheris.Setup(sys.argv, TestOneInput, enable_python_coverage=True)
32+
atheris.instrument_all()
33+
atheris.Fuzz()
3434

3535

3636
if __name__ == "__main__":
37-
main()
37+
main()

0 commit comments

Comments
 (0)