summaryrefslogtreecommitdiff
path: root/bin/fuzzfiles
blob: 99b503e3bd692c7d45ebf89efd03200de27efd22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /bin/bash
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

#check that zzuf is installed
hash zzuf &> /dev/null
if [ $? -eq 1 ];then
    echo >&2 "zzuf not found. Please install and/or fix the PATH environement variable. Aborting"
    exit -1
fi

#check that file(s) to fuzz are mentioned
if [[ $# -eq 0 ]]; then
    echo "Usage: fuzzfiles.sh <list of seed files to fuzz>"
    echo "The generated fuzzed files will be output to the current working directory"
    echo "The fuzzed files will be named XYZ-ratio-NNNN where:"
    echo -e "\tXYZ: the original file name"
    echo -e "\tratio: the fuzz ratio (what % of bytes were fuzzed)"
    echo -e "\tNNNN: the mutation # for that file and ratio combo"
    exit -1
fi

for file in $@; do
    if [ -d $file ]; then
        echo "$file is a directory. Only files are allowed"
    elif [ -e $file ]; then
        basename=${file##*/}
        #Sequence from 0.001 to 0.5
        for ratio in `seq -w 1 2 500 | sed -e 's/^/0./'`; do
            echo "Fuzzing $file with ratio $ratio"
            for i in {1..1000}; do
                zzuf -r $ratio < $file > "$basename-$ratio-$i"
                done #end of for i in {1..
            done #end of for ratio in ...
    fi #end if of file vailidity check
done #end for file in $@
1-28 20:24:39 +0100'>2014-01-28bool improvementsStephan Bergmann 2014-01-20misuse of OUString::boolean on sal_uInt8 valuesCaolán McNamara 2013-12-20typo fixesAndras Timar 2013-12-17No need for implbase1.hxx to include XComponentContext.hppStephan Bergmann 2013-12-16fdo#72598 Remove SunStudio cruft from code baseJelle van der Waa 2013-12-12Some clean-upStephan Bergmann 2013-12-12Remove newly unused comphelper/TypeGeneration.hxxStephan Bergmann 2013-12-12Simplify comphelper::PropertyInfoStephan Bergmann 2013-12-12Remove unnecessary comphelper::eqFuncStephan Bergmann 2013-12-12Fold SettingsHelperNoState, ChainableHelperNoStateStephan Bergmann 2013-12-12Remove unused comphelper::MasterHelperNoStateStephan Bergmann 2013-12-12Do not use C++-UNO internal static_type functions in client codeStephan Bergmann 2013-12-12Don't hold css::uno::Type instances by pointerStephan Bergmann 2013-12-11Revert "Don't hold css::uno::Type instances by pointer"Stephan Bergmann 2013-12-11Don't hold css::uno::Type instances by pointerStephan Bergmann 2013-12-06Clean up includes of comphelper/stl_types.hxxStephan Bergmann 2013-12-06Combine comphelper::UStringMixEqual, comphelper::TStringMixEqualFunctorStephan Bergmann 2013-12-06Remove unused comphelper::UStringIEqualStephan Bergmann 2013-12-06Get rid of unnecessary comphelper::UStringEqualStephan Bergmann