VirtualBox

source: vbox/trunk/src/libs/openssl-1.1.1g/fuzz/helper.py@ 85201

最後變更 在這個檔案從85201是 83916,由 vboxsync 提交於 5 年 前

openssl-1.1.1g: Applied and adjusted our OpenSSL changes to 1.1.1g. bugref:9719

  • 屬性 svn:executable 設為 *
檔案大小: 1.3 KB
 
1#!/usr/bin/python
2#
3# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
4#
5# Licensed under the OpenSSL license (the "License"). You may not use
6# this file except in compliance with the License. You can obtain a copy
7# in the file LICENSE in the source distribution or at
8# https://www.openssl.org/source/license.html
9
10"""Fuzzing helper, creates and uses corpus/crash directories.
11
12fuzzer.py <fuzzer> <extra fuzzer arguments>
13"""
14
15import os
16import subprocess
17import sys
18
19FUZZER = sys.argv[1]
20
21THIS_DIR = os.path.abspath(os.path.dirname(__file__))
22CORPORA_DIR = os.path.abspath(os.path.join(THIS_DIR, "corpora"))
23
24FUZZER_DIR = os.path.abspath(os.path.join(CORPORA_DIR, FUZZER))
25if not os.path.isdir(FUZZER_DIR):
26 os.mkdir(FUZZER_DIR)
27
28corpora = []
29
30def _create(d):
31 dd = os.path.abspath(os.path.join(CORPORA_DIR, d))
32 if not os.path.isdir(dd):
33 os.mkdir(dd)
34 corpora.append(dd)
35
36def _add(d):
37 dd = os.path.abspath(os.path.join(CORPORA_DIR, d))
38 if os.path.isdir(dd):
39 corpora.append(dd)
40
41def main():
42 _create(FUZZER)
43 _create(FUZZER + "-crash")
44 _add(FUZZER + "-seed")
45
46 cmd = ([os.path.abspath(os.path.join(THIS_DIR, FUZZER))] + sys.argv[2:]
47 + ["-artifact_prefix=" + corpora[1] + "/"] + corpora)
48 print(" ".join(cmd))
49 subprocess.call(cmd)
50
51if __name__ == "__main__":
52 main()
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette