From b74471706b8394d6b57bc657a9bab04e171af643 Mon Sep 17 00:00:00 2001 From: John Turner Date: Mon, 17 Nov 2025 20:02:16 +0000 Subject: communicate with python over a pipe to increase fuzzing performance --- scripts/atom.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'scripts/atom.py') diff --git a/scripts/atom.py b/scripts/atom.py index a1a59bd..2e8ca7f 100755 --- a/scripts/atom.py +++ b/scripts/atom.py @@ -1,13 +1,13 @@ #!/usr/bin/env python3 import sys -import portage.dep as dep - -input = sys.stdin.read().strip() - -try: - dep.Atom(input) -except Exception as e: - sys.exit(1) - -sys.exit(0) +from portage.dep import Atom + +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() -- cgit v1.2.3