File: fuzz_options_header.py

package info (click to toggle)
python-multipart 0.0.20-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 716 kB
  • sloc: python: 2,206; sh: 17; makefile: 5
file content (26 lines) | stat: -rw-r--r-- 504 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import sys

import atheris
from helpers import EnhancedDataProvider

with atheris.instrument_imports():
    from python_multipart.multipart import parse_options_header


def TestOneInput(data: bytes) -> None:
    fdp = EnhancedDataProvider(data)
    try:
        parse_options_header(fdp.ConsumeRandomBytes())
    except AssertionError:
        return
    except TypeError:
        return


def main():
    atheris.Setup(sys.argv, TestOneInput)
    atheris.Fuzz()


if __name__ == "__main__":
    main()