File: fuzz_atheris.py

package info (click to toggle)
python-picologging 0.9.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 752 kB
  • sloc: python: 3,921; cpp: 2,430; makefile: 41; sh: 18
file content (22 lines) | stat: -rw-r--r-- 435 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
import io

import atheris

with atheris.instrument_imports():
    import sys

    import picologging

    picologging.basicConfig()
    logger = picologging.Logger("fuzz", picologging.DEBUG)
    tmp = io.StringIO()
    logger.addHandler(picologging.StreamHandler(tmp))


def TestOneInput(data):
    fdp = atheris.FuzzedDataProvider(data)
    logger.warning(fdp.ConsumeUnicode(1))


atheris.Setup(sys.argv, TestOneInput)
atheris.Fuzz()