communicate with python over a pipe to increase fuzzing performance

This commit is contained in:
John Turner
2025-11-17 20:02:16 +00:00
parent 0cc3ac8e84
commit b74471706b
2 changed files with 69 additions and 35 deletions

View File

@@ -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()