mirror of https://github.com/google/oss-fuzz.git
Use only utf-8 for Pygments (#4859)
See https://github.com/pygments/pygments/issues/1628#issuecomment-747259224
This commit is contained in:
parent
77f468e95b
commit
86002c1f47
|
@ -22,11 +22,14 @@ import pygments.lexers
|
||||||
|
|
||||||
|
|
||||||
def TestOneInput(input_bytes):
|
def TestOneInput(input_bytes):
|
||||||
|
fdp = atheris.FuzzedDataProvider(input_bytes)
|
||||||
|
data = fdp.ConsumeUnicode(atheris.ALL_REMAINING)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
lexer = pygments.lexers.guess_lexer(str(input_bytes))
|
lexer = pygments.lexers.guess_lexer(data)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return
|
return
|
||||||
pygments.highlight(str(input_bytes), lexer, pygments.formatters.HtmlFormatter())
|
pygments.highlight(data, lexer, pygments.formatters.HtmlFormatter())
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Reference in New Issue