#! /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 " 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 $@ e-5-2 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-08-12 15:10:16 +0200
committerNoel Grandin <noel@peralex.com>2015-08-14 11:11:10 +0200
commit9e1d98fec2884e4c401aa0d5396612aa01773dc8 (patch)
tree1264e251a435c4d16c64f8b14efbbf825aee1827 /bin
parent371a535afbccd1cc405117ad5529fc980e041e68 (diff)
loplugin: defaultparams
Change-Id: I320eb6149793689c496b14090e8e0243397d01ba