forked from gentoo-utils/gentoo-utils
communicate with python over a pipe to increase fuzzing performance
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import portage.dep as dep
|
||||
from portage.dep import Atom
|
||||
|
||||
input = sys.stdin.read().strip()
|
||||
|
||||
try:
|
||||
dep.Atom(input)
|
||||
except Exception as e:
|
||||
sys.exit(1)
|
||||
|
||||
sys.exit(0)
|
||||
for line in sys.stdin.buffer:
|
||||
try:
|
||||
Atom(line.decode().strip())
|
||||
sys.stdout.buffer.write(b"0\n")
|
||||
except:
|
||||
sys.stdout.buffer.write(b"1\n")
|
||||
finally:
|
||||
sys.stdout.buffer.flush()
|
||||
|
||||
Reference in New Issue
Block a user