Skip to content

Commit

Permalink
do not use python, use bash
Browse files Browse the repository at this point in the history
  • Loading branch information
mikea committed Nov 2, 2016
1 parent 834612c commit 3f7ead2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 21 deletions.
2 changes: 1 addition & 1 deletion infra/base-images/base-libfuzzer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

FROM ossfuzz/base-clang
MAINTAINER mike.aizatsky@gmail.com
RUN apt-get install -y libc6-dev libtool git subversion jq zip python3
RUN apt-get install -y libc6-dev libtool git subversion jq zip

ENV SANITIZER_FLAGS="-fsanitize=address"
ENV COV_FLAGS="-fsanitize-coverage=edge,indirect-calls,8bit-counters"
Expand Down
31 changes: 11 additions & 20 deletions infra/base-images/base-libfuzzer/just_run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/bin/bash -eu
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,24 +17,15 @@

# Fuzzer runner.

import configparser
import os
import subprocess
import sys
FUZZER=$1
shift
CMD_LINE="$FUZZER $@"

run_args = sys.argv[1:]
OPTIONS_FILE="${FUZZER}.options"
if [ -f $OPTIONS_FILE ]; then
OPTIONS_ARGS=$(grep "=" $OPTIONS_FILE | sed 's/\(\w*\)\W*=\W*\(.*\)/-\1=\2 /g' | tr '\n' ' ')
CMD_LINE="$CMD_LINE $OPTIONS_ARGS"
fi

# Use .options file if any.
fuzzer_name = run_args[0]
options_file = fuzzer_name + ".options"
if os.path.isfile(options_file):
config = configparser.ConfigParser()
config.read(options_file)
for (key, value) in config["libfuzzer"].items():
run_args.append("-{0}={1}".format(key, value))

# Run
print("$", " ".join(run_args))
run_process = subprocess.Popen(run_args)
run_process.wait()
assert run_process.returncode == 0
echo $CMD_LINE
bash -c "$CMD_LINE"
1 change: 1 addition & 0 deletions targets/expat/parse_fuzzer.options
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[libfuzzer]
dict = xml.dict
max_len = 1024

0 comments on commit 3f7ead2

Please sign in to comment.