summaryrefslogtreecommitdiff
path: root/vcl/workben
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-02-25 15:32:50 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-02-25 15:45:02 +0000
commit1724d7db282ac997dc6d8e9d1e63486e141388f5 (patch)
treec2debc287e1899e27c65bfa9aed92d3f5a7de19d /vcl/workben
parentd176877bc0ccb8432e55eda2e7d620a246bccdde (diff)
oss-fuzz: issue 1188, per-fuzzer config
instead of copying the whole bunch around, now the scheme is to copy each individual fuzzer and matching config around, so duplicate the previously shared config for each one an Change-Id: I479ea13abfab382b6aee23bc04d5f7e535b489c9
Diffstat (limited to 'vcl/workben')
-rw-r--r--vcl/workben/commonfuzzer.hxx19
-rw-r--r--vcl/workben/sftfuzzer.options2
2 files changed, 16 insertions, 5 deletions
diff --git a/vcl/workben/commonfuzzer.hxx b/vcl/workben/commonfuzzer.hxx
index cc4830fa5990..05d35a4e1532 100644
--- a/vcl/workben/commonfuzzer.hxx
+++ b/vcl/workben/commonfuzzer.hxx
@@ -49,17 +49,25 @@ namespace
return uri;
}
+ OUString getExecutableName()
+ {
+ OUString uri;
+ if (osl_getExecutableFile(&uri.pData) != osl_Process_E_None) {
+ abort();
+ }
+ return uri.copy(uri.lastIndexOf('/') + 1);
+ }
+
void setFontConfigConf(const OUString &execdir)
{
osl::File aFontConfig("file:///tmp/wmffuzzerfonts.conf");
if (aFontConfig.open(osl_File_OpenFlag_Create | osl_File_OpenFlag_Write) == osl::File::E_None)
{
- OUString path;
- osl::FileBase::getSystemPathFromFileURL(execdir, path);
- OString sFontDir = OUStringToOString(path, osl_getThreadTextEncoding());
+ OUString sExecDir;
+ osl::FileBase::getSystemPathFromFileURL(execdir, sExecDir);
rtl::OStringBuffer aBuffer("<?xml version=\"1.0\"?>\n<fontconfig><dir>");
- aBuffer.append(sFontDir);
+ aBuffer.append(OUStringToOString(sExecDir + getExecutableName() + ".fonts", osl_getThreadTextEncoding());
aBuffer.append("</dir><cachedir>/tmp/cache/fontconfig</cachedir></fontconfig>");
rtl::OString aConf = aBuffer.makeStringAndClear();
sal_uInt64 aBytesWritten;
@@ -104,7 +112,8 @@ void CommonInitialize(int *argc, char ***argv)
tools::extendApplicationEnvironment();
- Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
+ Reference< XComponentContext > xContext =
+ defaultBootstrap_InitialComponentContext(sExecDir + getExecutableName() + ".unorc");
Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
if( !xServiceManager.is() )
Application::Abort( "Failed to bootstrap" );
diff --git a/vcl/workben/sftfuzzer.options b/vcl/workben/sftfuzzer.options
new file mode 100644
index 000000000000..678d526b1ea9
--- /dev/null
+++ b/vcl/workben/sftfuzzer.options
@@ -0,0 +1,2 @@
+[libfuzzer]
+max_len = 65536