/src/libreoffice/vcl/workben/ww2fuzzer.cxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | */ |
9 | | |
10 | | #include <tools/stream.hxx> |
11 | | #include <vcl/FilterConfigItem.hxx> |
12 | | #include "commonfuzzer.hxx" |
13 | | |
14 | | #include <config_features.h> |
15 | | #include <osl/detail/component-mapping.h> |
16 | | |
17 | | extern "C" { |
18 | | void * i18npool_component_getFactory( const char* , void* , void* ); |
19 | | |
20 | | void com_sun_star_comp_framework_Desktop_get_implementation(void); |
21 | | void com_sun_star_i18n_LocaleDataImpl_get_implementation(void); |
22 | | void com_sun_star_i18n_BreakIterator_Unicode_get_implementation(void); |
23 | | void com_sun_star_i18n_BreakIterator_get_implementation(void); |
24 | | void SfxDocumentMetaData_get_implementation(void); |
25 | | void com_sun_star_i18n_CharacterClassification_Unicode_get_implementation(void); |
26 | | void com_sun_star_i18n_CharacterClassification_get_implementation(void); |
27 | | void com_sun_star_i18n_NativeNumberSupplier_get_implementation(void); |
28 | | void com_sun_star_i18n_NumberFormatCodeMapper_get_implementation(void); |
29 | | void com_sun_star_comp_graphic_GraphicProvider_get_implementation(void); |
30 | | void IndexedPropertyValuesContainer_get_implementation(void); |
31 | | void com_sun_star_comp_uui_UUIInteractionHandler_get_implementation(void); |
32 | | void com_sun_star_i18n_Transliteration_get_implementation(void); |
33 | | void com_sun_star_text_DefaultNumberingProvider_get_implementation(void); |
34 | | void com_sun_star_comp_uri_UriReferenceFactory_get_implementation(void); |
35 | | void emfio_emfreader_XEmfParser_get_implementation(void); |
36 | | void i18npool_CalendarImpl_get_implementation(void); |
37 | | void i18npool_Calendar_gregorian_get_implementation(void); |
38 | | void unoxml_rdfRepository_get_implementation(void); |
39 | | void unoxml_CURI_get_implementation(void); |
40 | | void unoxml_CLiteral_get_implementation(void); |
41 | | void unoxml_CBlankNode_get_implementation(void); |
42 | | void unoxml_CXPathAPI_get_implementation(void); |
43 | | void unoxml_CSAXDocumentBuilder_get_implementation(void); |
44 | | void unoxml_CDocumentBuilder_get_implementation(void); |
45 | | void ucb_UcbCommandEnvironment_get_implementation(void); |
46 | | void ucb_UcbContentProviderProxyFactory_get_implementation(void); |
47 | | void ucb_UcbPropertiesManager_get_implementation(void); |
48 | | void ucb_UcbStore_get_implementation(void); |
49 | | void ucb_UniversalContentBroker_get_implementation(void); |
50 | | void ucb_OFileAccess_get_implementation(void); |
51 | | } |
52 | | |
53 | | const lib_to_factory_mapping * |
54 | | lo_get_factory_map(void) |
55 | 0 | { |
56 | 0 | static lib_to_factory_mapping map[] = { |
57 | 0 | { "libi18npoollo.a", i18npool_component_getFactory }, |
58 | 0 | { 0, 0 } |
59 | 0 | }; |
60 | |
|
61 | 0 | return map; |
62 | 0 | } |
63 | | |
64 | | const lib_to_constructor_mapping * |
65 | | lo_get_constructor_map(void) |
66 | 312k | { |
67 | 312k | static lib_to_constructor_mapping map[] = { |
68 | 312k | { "com_sun_star_comp_framework_Desktop_get_implementation", com_sun_star_comp_framework_Desktop_get_implementation }, |
69 | 312k | { "com_sun_star_i18n_LocaleDataImpl_get_implementation", com_sun_star_i18n_LocaleDataImpl_get_implementation }, |
70 | 312k | { "com_sun_star_i18n_BreakIterator_Unicode_get_implementation", com_sun_star_i18n_BreakIterator_Unicode_get_implementation }, |
71 | 312k | { "com_sun_star_i18n_BreakIterator_get_implementation", com_sun_star_i18n_BreakIterator_get_implementation }, |
72 | 312k | { "SfxDocumentMetaData_get_implementation", SfxDocumentMetaData_get_implementation }, |
73 | 312k | { "com_sun_star_i18n_CharacterClassification_Unicode_get_implementation", com_sun_star_i18n_CharacterClassification_Unicode_get_implementation }, |
74 | 312k | { "com_sun_star_i18n_CharacterClassification_get_implementation", com_sun_star_i18n_CharacterClassification_get_implementation }, |
75 | 312k | { "com_sun_star_i18n_NativeNumberSupplier_get_implementation", com_sun_star_i18n_NativeNumberSupplier_get_implementation }, |
76 | 312k | { "com_sun_star_i18n_NumberFormatCodeMapper_get_implementation", com_sun_star_i18n_NumberFormatCodeMapper_get_implementation }, |
77 | 312k | { "com_sun_star_comp_graphic_GraphicProvider_get_implementation", com_sun_star_comp_graphic_GraphicProvider_get_implementation }, |
78 | 312k | { "IndexedPropertyValuesContainer_get_implementation", IndexedPropertyValuesContainer_get_implementation }, |
79 | 312k | { "com_sun_star_comp_uui_UUIInteractionHandler_get_implementation", com_sun_star_comp_uui_UUIInteractionHandler_get_implementation }, |
80 | 312k | { "com_sun_star_i18n_Transliteration_get_implementation", com_sun_star_i18n_Transliteration_get_implementation }, |
81 | 312k | { "com_sun_star_text_DefaultNumberingProvider_get_implementation", com_sun_star_text_DefaultNumberingProvider_get_implementation }, |
82 | 312k | { "com_sun_star_comp_uri_UriReferenceFactory_get_implementation", com_sun_star_comp_uri_UriReferenceFactory_get_implementation}, |
83 | 312k | { "emfio_emfreader_XEmfParser_get_implementation", emfio_emfreader_XEmfParser_get_implementation}, |
84 | 312k | { "i18npool_CalendarImpl_get_implementation", i18npool_CalendarImpl_get_implementation}, |
85 | 312k | { "i18npool_Calendar_gregorian_get_implementation", i18npool_Calendar_gregorian_get_implementation}, |
86 | 312k | { "unoxml_rdfRepository_get_implementation", unoxml_rdfRepository_get_implementation }, |
87 | 312k | { "unoxml_CURI_get_implementation", unoxml_CURI_get_implementation }, |
88 | 312k | { "unoxml_CLiteral_get_implementation", unoxml_CLiteral_get_implementation }, |
89 | 312k | { "unoxml_CBlankNode_get_implementation", unoxml_CBlankNode_get_implementation }, |
90 | 312k | { "unoxml_CXPathAPI_get_implementation", unoxml_CXPathAPI_get_implementation }, |
91 | 312k | { "unoxml_CSAXDocumentBuilder_get_implementation", unoxml_CSAXDocumentBuilder_get_implementation }, |
92 | 312k | { "unoxml_CDocumentBuilder_get_implementation", unoxml_CDocumentBuilder_get_implementation }, |
93 | 312k | { "ucb_UcbCommandEnvironment_get_implementation", ucb_UcbCommandEnvironment_get_implementation, }, |
94 | 312k | { "ucb_UcbContentProviderProxyFactory_get_implementation", ucb_UcbContentProviderProxyFactory_get_implementation }, |
95 | 312k | { "ucb_UcbPropertiesManager_get_implementation", ucb_UcbPropertiesManager_get_implementation }, |
96 | 312k | { "ucb_UcbStore_get_implementation", ucb_UcbStore_get_implementation }, |
97 | 312k | { "ucb_UniversalContentBroker_get_implementation", ucb_UniversalContentBroker_get_implementation }, |
98 | 312k | { "ucb_OFileAccess_get_implementation", ucb_OFileAccess_get_implementation }, |
99 | 312k | { 0, 0 } |
100 | 312k | }; |
101 | | |
102 | 312k | return map; |
103 | 312k | } |
104 | | |
105 | | extern "C" void* lo_get_custom_widget_func(const char*) |
106 | 0 | { |
107 | 0 | return nullptr; |
108 | 0 | } |
109 | | |
110 | | extern "C" bool TestImportWW2(SvStream &rStream); |
111 | | |
112 | | extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) |
113 | 88 | { |
114 | 88 | TypicalFuzzerInitialize(argc, argv); |
115 | 88 | return 0; |
116 | 88 | } |
117 | | |
118 | | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) |
119 | 368k | { |
120 | 368k | SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ); |
121 | 368k | (void)TestImportWW2(aStream); |
122 | 368k | return 0; |
123 | 368k | } |
124 | | |
125 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |