/src/libreoffice/vcl/workben/ww6fuzzer.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_comp_comphelper_OPropertyBag(void); |
33 | | void com_sun_star_i18n_Transliteration_get_implementation(void); |
34 | | void com_sun_star_text_DefaultNumberingProvider_get_implementation(void); |
35 | | void com_sun_star_comp_uri_UriReferenceFactory_get_implementation(void); |
36 | | void emfio_emfreader_XEmfParser_get_implementation(void); |
37 | | void i18npool_CalendarImpl_get_implementation(void); |
38 | | void i18npool_Calendar_gregorian_get_implementation(void); |
39 | | void unoxml_rdfRepository_get_implementation(void); |
40 | | void unoxml_CURI_get_implementation(void); |
41 | | void unoxml_CLiteral_get_implementation(void); |
42 | | void unoxml_CBlankNode_get_implementation(void); |
43 | | void unoxml_CXPathAPI_get_implementation(void); |
44 | | void unoxml_CSAXDocumentBuilder_get_implementation(void); |
45 | | void unoxml_CDocumentBuilder_get_implementation(void); |
46 | | void ucb_UcbCommandEnvironment_get_implementation(void); |
47 | | void ucb_UcbContentProviderProxyFactory_get_implementation(void); |
48 | | void ucb_UcbPropertiesManager_get_implementation(void); |
49 | | void ucb_UcbStore_get_implementation(void); |
50 | | void ucb_UniversalContentBroker_get_implementation(void); |
51 | | void ucb_OFileAccess_get_implementation(void); |
52 | | } |
53 | | |
54 | | const lib_to_factory_mapping * |
55 | | lo_get_factory_map(void) |
56 | 0 | { |
57 | 0 | static lib_to_factory_mapping map[] = { |
58 | 0 | { "libi18npoollo.a", i18npool_component_getFactory }, |
59 | 0 | { 0, 0 } |
60 | 0 | }; |
61 | |
|
62 | 0 | return map; |
63 | 0 | } |
64 | | |
65 | | const lib_to_constructor_mapping * |
66 | | lo_get_constructor_map(void) |
67 | 347k | { |
68 | 347k | static lib_to_constructor_mapping map[] = { |
69 | 347k | { "com_sun_star_comp_framework_Desktop_get_implementation", com_sun_star_comp_framework_Desktop_get_implementation }, |
70 | 347k | { "com_sun_star_i18n_LocaleDataImpl_get_implementation", com_sun_star_i18n_LocaleDataImpl_get_implementation }, |
71 | 347k | { "com_sun_star_i18n_BreakIterator_Unicode_get_implementation", com_sun_star_i18n_BreakIterator_Unicode_get_implementation }, |
72 | 347k | { "com_sun_star_i18n_BreakIterator_get_implementation", com_sun_star_i18n_BreakIterator_get_implementation }, |
73 | 347k | { "SfxDocumentMetaData_get_implementation", SfxDocumentMetaData_get_implementation }, |
74 | 347k | { "com_sun_star_i18n_CharacterClassification_Unicode_get_implementation", com_sun_star_i18n_CharacterClassification_Unicode_get_implementation }, |
75 | 347k | { "com_sun_star_i18n_CharacterClassification_get_implementation", com_sun_star_i18n_CharacterClassification_get_implementation }, |
76 | 347k | { "com_sun_star_i18n_NativeNumberSupplier_get_implementation", com_sun_star_i18n_NativeNumberSupplier_get_implementation }, |
77 | 347k | { "com_sun_star_i18n_NumberFormatCodeMapper_get_implementation", com_sun_star_i18n_NumberFormatCodeMapper_get_implementation }, |
78 | 347k | { "com_sun_star_comp_graphic_GraphicProvider_get_implementation", com_sun_star_comp_graphic_GraphicProvider_get_implementation }, |
79 | 347k | { "IndexedPropertyValuesContainer_get_implementation", IndexedPropertyValuesContainer_get_implementation }, |
80 | 347k | { "com_sun_star_comp_uui_UUIInteractionHandler_get_implementation", com_sun_star_comp_uui_UUIInteractionHandler_get_implementation }, |
81 | 347k | { "com_sun_star_comp_comphelper_OPropertyBag", com_sun_star_comp_comphelper_OPropertyBag }, |
82 | 347k | { "com_sun_star_i18n_Transliteration_get_implementation", com_sun_star_i18n_Transliteration_get_implementation }, |
83 | 347k | { "com_sun_star_text_DefaultNumberingProvider_get_implementation", com_sun_star_text_DefaultNumberingProvider_get_implementation }, |
84 | 347k | { "com_sun_star_comp_uri_UriReferenceFactory_get_implementation", com_sun_star_comp_uri_UriReferenceFactory_get_implementation}, |
85 | 347k | { "emfio_emfreader_XEmfParser_get_implementation", emfio_emfreader_XEmfParser_get_implementation}, |
86 | 347k | { "i18npool_CalendarImpl_get_implementation", i18npool_CalendarImpl_get_implementation }, |
87 | 347k | { "i18npool_Calendar_gregorian_get_implementation", i18npool_Calendar_gregorian_get_implementation}, |
88 | 347k | { "unoxml_rdfRepository_get_implementation", unoxml_rdfRepository_get_implementation }, |
89 | 347k | { "unoxml_CURI_get_implementation", unoxml_CURI_get_implementation }, |
90 | 347k | { "unoxml_CLiteral_get_implementation", unoxml_CLiteral_get_implementation }, |
91 | 347k | { "unoxml_CBlankNode_get_implementation", unoxml_CBlankNode_get_implementation }, |
92 | 347k | { "unoxml_CXPathAPI_get_implementation", unoxml_CXPathAPI_get_implementation }, |
93 | 347k | { "unoxml_CSAXDocumentBuilder_get_implementation", unoxml_CSAXDocumentBuilder_get_implementation }, |
94 | 347k | { "unoxml_CDocumentBuilder_get_implementation", unoxml_CDocumentBuilder_get_implementation }, |
95 | 347k | { "ucb_UcbCommandEnvironment_get_implementation", ucb_UcbCommandEnvironment_get_implementation, }, |
96 | 347k | { "ucb_UcbContentProviderProxyFactory_get_implementation", ucb_UcbContentProviderProxyFactory_get_implementation }, |
97 | 347k | { "ucb_UcbPropertiesManager_get_implementation", ucb_UcbPropertiesManager_get_implementation }, |
98 | 347k | { "ucb_UcbStore_get_implementation", ucb_UcbStore_get_implementation }, |
99 | 347k | { "ucb_UniversalContentBroker_get_implementation", ucb_UniversalContentBroker_get_implementation }, |
100 | 347k | { "ucb_OFileAccess_get_implementation", ucb_OFileAccess_get_implementation }, |
101 | 347k | { 0, 0 } |
102 | 347k | }; |
103 | | |
104 | 347k | return map; |
105 | 347k | } |
106 | | |
107 | | extern "C" void* lo_get_custom_widget_func(const char*) |
108 | 0 | { |
109 | 0 | return nullptr; |
110 | 0 | } |
111 | | |
112 | | extern "C" bool TestImportWW6(SvStream &rStream); |
113 | | |
114 | | extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) |
115 | 94 | { |
116 | 94 | TypicalFuzzerInitialize(argc, argv); |
117 | 94 | return 0; |
118 | 94 | } |
119 | | |
120 | | extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) |
121 | 457k | { |
122 | 457k | SvMemoryStream aStream(const_cast<uint8_t*>(data), size, StreamMode::READ); |
123 | 457k | (void)TestImportWW6(aStream); |
124 | 457k | return 0; |
125 | 457k | } |
126 | | |
127 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |