react-native-nitro-xlsx 0.1.4 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NitroXlsx.podspec +27 -27
- package/Package.swift +35 -10
- package/README.md +220 -58
- package/android/CMakeLists.txt +24 -27
- package/android/cpp-adapter.cpp +12 -0
- package/android/src/main/java/com/margelo/nitro/xlsx/NitroXlsxPackage.kt +9 -0
- package/cpp/HybridNitroXlsx.cpp +25 -179
- package/cpp/HybridNitroXlsx.hpp +2 -2
- package/cpp/HybridXlsxConditionalFormat.cpp +252 -0
- package/cpp/HybridXlsxConditionalFormat.hpp +62 -0
- package/cpp/HybridXlsxConditionalFormats.cpp +46 -0
- package/cpp/HybridXlsxConditionalFormats.hpp +28 -0
- package/cpp/HybridXlsxWorkbook.cpp +159 -196
- package/cpp/HybridXlsxWorkbook.hpp +7 -2
- package/cpp/HybridXlsxWorksheet.cpp +433 -62
- package/cpp/HybridXlsxWorksheet.hpp +73 -26
- package/cpp/XlsxCacheDir.cpp +76 -0
- package/cpp/XlsxCacheDir.hpp +27 -0
- package/cpp/XlsxError.hpp +68 -0
- package/cpp/XlsxJson.cpp +185 -0
- package/cpp/XlsxJson.hpp +36 -0
- package/ios/XlsxCacheDir.mm +60 -0
- package/nitrogen/generated/android/NitroXlsx+autolinking.cmake +2 -0
- package/nitrogen/generated/shared/c++/HybridNitroXlsxSpec.hpp +5 -3
- package/nitrogen/generated/shared/c++/HybridXlsxConditionalFormatSpec.cpp +54 -0
- package/nitrogen/generated/shared/c++/HybridXlsxConditionalFormatSpec.hpp +95 -0
- package/nitrogen/generated/shared/c++/HybridXlsxConditionalFormatsSpec.cpp +24 -0
- package/nitrogen/generated/shared/c++/HybridXlsxConditionalFormatsSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/HybridXlsxWorkbookSpec.cpp +3 -0
- package/nitrogen/generated/shared/c++/HybridXlsxWorkbookSpec.hpp +6 -1
- package/nitrogen/generated/shared/c++/HybridXlsxWorksheetSpec.cpp +47 -19
- package/nitrogen/generated/shared/c++/HybridXlsxWorksheetSpec.hpp +52 -20
- package/package.json +3 -3
- package/scripts/run-cpp-tests.sh +14 -0
- package/src/__mocks__/react-native-nitro-modules.ts +1 -0
- package/src/__tests__/index.test.ts +76 -7
- package/src/index.ts +107 -18
- package/src/specs/NitroXlsx.nitro.ts +141 -44
- package/thirdparty/OpenXLSX/.clang-format +118 -0
- package/thirdparty/OpenXLSX/.clang-tidy +28 -0
- package/thirdparty/OpenXLSX/.gitignore +130 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_before_XMLNode_wrappers +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_and_stripping +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_char_support +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespace_support +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-07-29-benchmarks_with_XMLNode_wrappers_and_namespaced_name_disabled +49 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-08-11-benchmarks_post-XLCellIterator-Rework +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-08-14-benchmarks_post-default-row-column-style-support +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-09-02-benchmarks +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-12-19-benchmarks +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2024-12-30-benchmarks-post-XLSharedStrings-by-ref +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-09-benchmarks-post-conditionalFormatsAndSheetProtection +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-10-benchmarks-post-XLCellValue-bugfix +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-01-31-benchmarks-post-XLComments-implementation +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-02-02-benchmarks-post-XLRowIterator-Rework +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-07-20-benchmarks-after-hiding-pugixml-internals +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/2025-08-29-benchmarks-after-code-review-with-libzip +46 -0
- package/thirdparty/OpenXLSX/Benchmarks/Benchmark.cpp +249 -0
- package/thirdparty/OpenXLSX/Benchmarks/CMakeLists.txt +19 -0
- package/thirdparty/OpenXLSX/CMakeLists.txt +466 -0
- package/thirdparty/OpenXLSX/Documentation/CMakeLists.txt +31 -0
- package/thirdparty/OpenXLSX/Documentation/Doxyfile.in +2471 -0
- package/thirdparty/OpenXLSX/Documentation/DoxygenLayout.xml +194 -0
- package/thirdparty/OpenXLSX/Documentation/customdoxygen.css +1355 -0
- package/thirdparty/OpenXLSX/Examples/CMakeLists.txt +103 -0
- package/thirdparty/OpenXLSX/Examples/Demo1.cpp +279 -0
- package/thirdparty/OpenXLSX/Examples/Demo10.cpp +545 -0
- package/thirdparty/OpenXLSX/Examples/Demo1A.cpp +137 -0
- package/thirdparty/OpenXLSX/Examples/Demo2.cpp +65 -0
- package/thirdparty/OpenXLSX/Examples/Demo3.cpp +89 -0
- package/thirdparty/OpenXLSX/Examples/Demo4.cpp +86 -0
- package/thirdparty/OpenXLSX/Examples/Demo5.cpp +77 -0
- package/thirdparty/OpenXLSX/Examples/Demo6.cpp +103 -0
- package/thirdparty/OpenXLSX/Examples/Demo7.cpp +79 -0
- package/thirdparty/OpenXLSX/Examples/Demo8.cpp +117 -0
- package/thirdparty/OpenXLSX/Examples/Demo9.cpp +363 -0
- package/thirdparty/OpenXLSX/Examples/cmake/FindLIBZIP.cmake +61 -0
- package/thirdparty/OpenXLSX/Examples/external/CustomZip/CustomZip.hpp +256 -0
- package/thirdparty/OpenXLSX/LICENSE.md +29 -0
- package/thirdparty/OpenXLSX/Makefile.GNU +530 -0
- package/thirdparty/OpenXLSX/Notes/TBDs.txt +16 -0
- package/thirdparty/OpenXLSX/Notes/confirmed-TBCs.txt +8 -0
- package/thirdparty/OpenXLSX/Notes/styles-missing-support.xml +12 -0
- package/thirdparty/OpenXLSX/Notes/todo-list.txt +108 -0
- package/thirdparty/OpenXLSX/OpenXLSX/CMakeLists.txt +631 -0
- package/thirdparty/OpenXLSX/OpenXLSX/OpenXLSX.hpp +63 -0
- package/thirdparty/OpenXLSX/OpenXLSX/OpenXLSXConfig.cmake +11 -0
- package/thirdparty/OpenXLSX/OpenXLSX/cmake/bundle_static_library.cmake +198 -0
- package/thirdparty/OpenXLSX/OpenXLSX/cmake/patch_pkg_config.cmake +69 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/IZipArchive.hpp +361 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/OpenXLSX-Exports.hpp +12 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCell.hpp +367 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellIterator.hpp +252 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellRange.hpp +223 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellReference.hpp +317 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCellValue.hpp +793 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLColor.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLColumn.hpp +159 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLCommandQuery.hpp +228 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLComments.hpp +270 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLConstants.hpp +18 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLContentTypes.hpp +264 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDateTime.hpp +175 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDocument.hpp +505 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLDrawing.hpp +452 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLException.hpp +161 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLFormula.hpp +375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLIterator.hpp +40 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLMergeCells.hpp +216 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLProperties.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRelationships.hpp +348 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRow.hpp +721 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLRowData.hpp +488 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLSharedStrings.hpp +204 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLSheet.hpp +1640 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLStyles.hpp +2390 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLTables.hpp +132 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLWorkbook.hpp +404 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlData.hpp +283 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlFile.hpp +194 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlParser.hpp +282 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLXmlParserForwardDeclarations.hpp +85 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/XLZipArchive.hpp +232 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/LibZip.hpp +447 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/OpenXLSXFileSystemTools.hpp +207 -0
- package/thirdparty/OpenXLSX/OpenXLSX/headers/detail/Zippy.hpp +1375 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCell.cpp +340 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellIterator.cpp +427 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellRange.cpp +221 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellReference.cpp +408 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLCellValue.cpp +519 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLColor.cpp +202 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLColumn.cpp +141 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLComments.cpp +637 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLContentTypes.cpp +329 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDateTime.cpp +269 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDocument.cpp +1678 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLDrawing.cpp +784 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLFormula.cpp +201 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLMergeCells.cpp +357 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLProperties.cpp +810 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRelationships.cpp +529 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRow.cpp +918 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLRowData.cpp +508 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLSharedStrings.cpp +220 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLSheet.cpp +1970 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLStyles.cpp +3014 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLTables.cpp +125 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLWorkbook.cpp +784 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlData.cpp +247 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlFile.cpp +160 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLXmlParser.cpp +261 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/XLZipArchive.cpp +266 -0
- package/thirdparty/OpenXLSX/OpenXLSX/sources/utilities/XLUtilities.hpp +478 -0
- package/thirdparty/OpenXLSX/README.md +1279 -0
- package/thirdparty/OpenXLSX/Scripts/cmake-cleanup.sh +102 -0
- package/thirdparty/OpenXLSX/Scripts/compile.sh +23 -0
- package/thirdparty/OpenXLSX/Scripts/demos-cleanup.sh +25 -0
- package/thirdparty/OpenXLSX/Scripts/demos-run-all.sh +60 -0
- package/thirdparty/OpenXLSX/Scripts/guarded-xml-format.sh +47 -0
- package/thirdparty/OpenXLSX/Scripts/make-gnu.sh +11 -0
- package/thirdparty/OpenXLSX/Scripts/uninstall-manifest.sh +48 -0
- package/thirdparty/OpenXLSX/Scripts/xml-format-all.sh +19 -0
- package/thirdparty/OpenXLSX/Scripts/xml-format.sh +38 -0
- package/thirdparty/OpenXLSX/Tests/CMakeLists.txt +37 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch.hpp +17799 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_automake.hpp +68 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_sonarqube.hpp +182 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_tap.hpp +278 -0
- package/thirdparty/OpenXLSX/Tests/catch/catch_reporter_teamcity.hpp +212 -0
- package/thirdparty/OpenXLSX/Tests/main.cpp +55 -0
- package/thirdparty/OpenXLSX/Tests/testXLCell.cpp +176 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellRange.cpp +180 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellReference.cpp +160 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellValue.cpp +366 -0
- package/thirdparty/OpenXLSX/Tests/testXLCellValueProxy.cpp +255 -0
- package/thirdparty/OpenXLSX/Tests/testXLColor.cpp +75 -0
- package/thirdparty/OpenXLSX/Tests/testXLDateTime.cpp +229 -0
- package/thirdparty/OpenXLSX/Tests/testXLDocument.cpp +197 -0
- package/thirdparty/OpenXLSX/Tests/testXLFormula.cpp +131 -0
- package/thirdparty/OpenXLSX/Tests/testXLRow.cpp +597 -0
- package/thirdparty/OpenXLSX/Tests/testXLSheet.cpp +77 -0
- package/thirdparty/OpenXLSX/Tests/ziptest-with-libs.cpp +88 -0
- package/thirdparty/OpenXLSX/Tests/ziptest.cpp +735 -0
- package/thirdparty/OpenXLSX/cmake/get-git-HEAD-ID.cmake +45 -0
- package/thirdparty/OpenXLSX/cmake/libopenxlsxCPackOptions.cmake.in +20 -0
- package/thirdparty/OpenXLSX/cmake/manage_dependency.cmake +813 -0
- package/thirdparty/OpenXLSX/cmake/recursive_library_type_test.cmake +52 -0
- package/thirdparty/OpenXLSX/gnu-make-crutch/OpenXLSX-Exports-shared.hpp +42 -0
- package/thirdparty/OpenXLSX/gnu-make-crutch/OpenXLSX-Exports-static.hpp +42 -0
- package/thirdparty/OpenXLSX/vcpkg.json +24 -0
- package/thirdparty/README.md +42 -0
- package/thirdparty/miniz/.clang-format +47 -0
- package/thirdparty/miniz/.travis.yml +2 -0
- package/thirdparty/miniz/CMakeLists.txt +333 -0
- package/thirdparty/miniz/CMakePresets.json +31 -0
- package/thirdparty/miniz/ChangeLog.md +272 -0
- package/thirdparty/miniz/Config.cmake.in +1 -0
- package/thirdparty/miniz/LICENSE +22 -0
- package/thirdparty/miniz/amalgamate.sh +57 -0
- package/thirdparty/miniz/examples/example1.c +105 -0
- package/thirdparty/miniz/examples/example2.c +164 -0
- package/thirdparty/miniz/examples/example3.c +269 -0
- package/thirdparty/miniz/examples/example4.c +102 -0
- package/thirdparty/miniz/examples/example5.c +327 -0
- package/thirdparty/miniz/examples/example6.c +189 -0
- package/thirdparty/miniz/meson.build +21 -0
- package/thirdparty/miniz/miniz.c +646 -0
- package/thirdparty/miniz/miniz.h +615 -0
- package/thirdparty/miniz/miniz.pc.in +13 -0
- package/thirdparty/miniz/miniz_common.h +89 -0
- package/thirdparty/miniz/miniz_export.h +20 -0
- package/thirdparty/miniz/miniz_tdef.c +1602 -0
- package/thirdparty/miniz/miniz_tdef.h +199 -0
- package/thirdparty/miniz/miniz_tinfl.c +778 -0
- package/thirdparty/miniz/miniz_tinfl.h +150 -0
- package/thirdparty/miniz/miniz_zip.c +4895 -0
- package/thirdparty/miniz/miniz_zip.h +454 -0
- package/thirdparty/miniz/readme.md +46 -0
- package/thirdparty/miniz/test.sh +36 -0
- package/thirdparty/miniz/tests/add_in_place_fuzzer.c +87 -0
- package/thirdparty/miniz/tests/catch_amalgamated.cpp +10795 -0
- package/thirdparty/miniz/tests/catch_amalgamated.hpp +13143 -0
- package/thirdparty/miniz/tests/checksum_fuzzer.c +26 -0
- package/thirdparty/miniz/tests/compress_fuzzer.c +91 -0
- package/thirdparty/miniz/tests/flush_fuzzer.c +88 -0
- package/thirdparty/miniz/tests/fuzz_main.c +55 -0
- package/thirdparty/miniz/tests/large_fuzzer.c +133 -0
- package/thirdparty/miniz/tests/main.cpp +185 -0
- package/thirdparty/miniz/tests/miniz_tdefl_fuzzer.cc +115 -0
- package/thirdparty/miniz/tests/miniz_tester.cpp +1881 -0
- package/thirdparty/miniz/tests/miniz_zip_validate_fuzzer.cc +71 -0
- package/thirdparty/miniz/tests/miniz_zip_writer_fuzzer.cc +96 -0
- package/thirdparty/miniz/tests/ossfuzz.sh +48 -0
- package/thirdparty/miniz/tests/small_fuzzer.c +126 -0
- package/thirdparty/miniz/tests/timer.cpp +152 -0
- package/thirdparty/miniz/tests/timer.h +40 -0
- package/thirdparty/miniz/tests/uncompress2_fuzzer.c +21 -0
- package/thirdparty/miniz/tests/uncompress_fuzzer.c +30 -0
- package/thirdparty/miniz/tests/zip.dict +9 -0
- package/thirdparty/miniz/tests/zip_fuzzer.c +63 -0
- package/thirdparty/pugixml/.codecov.yml +7 -0
- package/thirdparty/pugixml/.gitattributes +1 -0
- package/thirdparty/pugixml/CMakeLists.txt +330 -0
- package/thirdparty/pugixml/LICENSE.md +24 -0
- package/thirdparty/pugixml/Makefile +98 -0
- package/thirdparty/pugixml/README.md +81 -0
- package/thirdparty/pugixml/SECURITY.md +9 -0
- package/thirdparty/pugixml/appveyor.yml +50 -0
- package/thirdparty/pugixml/docs/config.adoc +7 -0
- package/thirdparty/pugixml/docs/images/dom_tree.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_link1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_link2.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch2.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch3.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2005_pch4.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2010_link1.png +0 -0
- package/thirdparty/pugixml/docs/images/vs2010_link2.png +0 -0
- package/thirdparty/pugixml/docs/manual.adoc +3326 -0
- package/thirdparty/pugixml/docs/manual.html +6395 -0
- package/thirdparty/pugixml/docs/quickstart.adoc +287 -0
- package/thirdparty/pugixml/docs/quickstart.html +1107 -0
- package/thirdparty/pugixml/docs/samples/character.xml +8 -0
- package/thirdparty/pugixml/docs/samples/custom_memory_management.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/include.cpp +64 -0
- package/thirdparty/pugixml/docs/samples/load_error_handling.cpp +33 -0
- package/thirdparty/pugixml/docs/samples/load_file.cpp +16 -0
- package/thirdparty/pugixml/docs/samples/load_memory.cpp +66 -0
- package/thirdparty/pugixml/docs/samples/load_options.cpp +30 -0
- package/thirdparty/pugixml/docs/samples/load_stream.cpp +97 -0
- package/thirdparty/pugixml/docs/samples/modify_add.cpp +29 -0
- package/thirdparty/pugixml/docs/samples/modify_base.cpp +43 -0
- package/thirdparty/pugixml/docs/samples/modify_remove.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/save_custom_writer.cpp +116 -0
- package/thirdparty/pugixml/docs/samples/save_declaration.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/save_file.cpp +17 -0
- package/thirdparty/pugixml/docs/samples/save_options.cpp +48 -0
- package/thirdparty/pugixml/docs/samples/save_stream.cpp +18 -0
- package/thirdparty/pugixml/docs/samples/save_subtree.cpp +26 -0
- package/thirdparty/pugixml/docs/samples/text.cpp +35 -0
- package/thirdparty/pugixml/docs/samples/transitions.xml +7 -0
- package/thirdparty/pugixml/docs/samples/traverse_base.cpp +51 -0
- package/thirdparty/pugixml/docs/samples/traverse_iter.cpp +27 -0
- package/thirdparty/pugixml/docs/samples/traverse_predicate.cpp +48 -0
- package/thirdparty/pugixml/docs/samples/traverse_rangefor.cpp +32 -0
- package/thirdparty/pugixml/docs/samples/traverse_walker.cpp +35 -0
- package/thirdparty/pugixml/docs/samples/tree.xml +12 -0
- package/thirdparty/pugixml/docs/samples/weekly-shift_jis.xml +78 -0
- package/thirdparty/pugixml/docs/samples/weekly-utf-16.xml +0 -0
- package/thirdparty/pugixml/docs/samples/weekly-utf-8.xml +78 -0
- package/thirdparty/pugixml/docs/samples/xgconsole.xml +12 -0
- package/thirdparty/pugixml/docs/samples/xpath_error.cpp +43 -0
- package/thirdparty/pugixml/docs/samples/xpath_query.cpp +36 -0
- package/thirdparty/pugixml/docs/samples/xpath_select.cpp +28 -0
- package/thirdparty/pugixml/docs/samples/xpath_variables.cpp +38 -0
- package/thirdparty/pugixml/readme.txt +50 -0
- package/thirdparty/pugixml/scripts/archive.py +54 -0
- package/thirdparty/pugixml/scripts/cocoapods_push.sh +4 -0
- package/thirdparty/pugixml/scripts/natvis/pugixml.natvis +77 -0
- package/thirdparty/pugixml/scripts/natvis/pugixml_compact.natvis +506 -0
- package/thirdparty/pugixml/scripts/nuget/build/native/pugixml-propertiesui.xml +17 -0
- package/thirdparty/pugixml/scripts/nuget/build/native/pugixml.targets +28 -0
- package/thirdparty/pugixml/scripts/nuget/pugixml.nuspec +20 -0
- package/thirdparty/pugixml/scripts/nuget_build.ps1 +60 -0
- package/thirdparty/pugixml/scripts/premake4.lua +92 -0
- package/thirdparty/pugixml/scripts/pugixml-config.cmake.in +12 -0
- package/thirdparty/pugixml/scripts/pugixml.pc.in +11 -0
- package/thirdparty/pugixml/scripts/pugixml.podspec +14 -0
- package/thirdparty/pugixml/scripts/pugixml.xcodeproj/project.pbxproj +212 -0
- package/thirdparty/pugixml/scripts/pugixml_airplay.mkf +13 -0
- package/thirdparty/pugixml/scripts/pugixml_codeblocks.cbp +44 -0
- package/thirdparty/pugixml/scripts/pugixml_codelite.project +56 -0
- package/thirdparty/pugixml/scripts/pugixml_dll.rc +45 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2005.vcproj +343 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2005_static.vcproj +343 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2008.vcproj +339 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2008_static.vcproj +339 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2010.vcxproj +191 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2010_static.vcxproj +191 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2013.vcxproj +199 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2013_static.vcxproj +199 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2015.vcxproj +172 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2015_static.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2017.vcxproj +172 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2017_static.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2019.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2019_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2022.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2022_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2026.vcxproj +176 -0
- package/thirdparty/pugixml/scripts/pugixml_vs2026_static.vcxproj +180 -0
- package/thirdparty/pugixml/scripts/sbom.cdx.json +47 -0
- package/thirdparty/pugixml/src/pugiconfig.hpp +81 -0
- package/thirdparty/pugixml/src/pugixml.cpp +13776 -0
- package/thirdparty/pugixml/src/pugixml.hpp +1604 -0
- package/thirdparty/pugixml/tests/allocator.cpp +175 -0
- package/thirdparty/pugixml/tests/allocator.hpp +10 -0
- package/thirdparty/pugixml/tests/autotest-appveyor.ps1 +93 -0
- package/thirdparty/pugixml/tests/cmake-appveyor.ps1 +57 -0
- package/thirdparty/pugixml/tests/data/empty.xml +0 -0
- package/thirdparty/pugixml/tests/data/large.xml +1 -0
- package/thirdparty/pugixml/tests/data/latintest_latin1.xml +1 -0
- package/thirdparty/pugixml/tests/data/latintest_utf8.xml +1 -0
- package/thirdparty/pugixml/tests/data/multiline.xml +3 -0
- package/thirdparty/pugixml/tests/data/small.xml +1 -0
- package/thirdparty/pugixml/tests/data/truncation.xml +19 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_be_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf16_le_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_be_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_bom.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_clean.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf32_le_nodecl.xml +0 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8.xml +87 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_bom.xml +87 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_clean.xml +84 -0
- package/thirdparty/pugixml/tests/data/utftest_utf8_nodecl.xml +86 -0
- package/thirdparty/pugixml/tests/data//321/202/320/265/321/201/321/202.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/basic.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/doctype.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/refs.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/types.xml +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/utf16.xml +0 -0
- package/thirdparty/pugixml/tests/data_fuzz_parse/utf32.xml +0 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/basic.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/functions.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/math.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/path.xpath +1 -0
- package/thirdparty/pugixml/tests/data_fuzz_xpath/predicate.xpath +1 -0
- package/thirdparty/pugixml/tests/fuzz_parse.cpp +14 -0
- package/thirdparty/pugixml/tests/fuzz_parse.dict +72 -0
- package/thirdparty/pugixml/tests/fuzz_setup.sh +11 -0
- package/thirdparty/pugixml/tests/fuzz_xpath.cpp +46 -0
- package/thirdparty/pugixml/tests/fuzz_xpath.dict +72 -0
- package/thirdparty/pugixml/tests/helpers.hpp +114 -0
- package/thirdparty/pugixml/tests/main.cpp +218 -0
- package/thirdparty/pugixml/tests/test.cpp +220 -0
- package/thirdparty/pugixml/tests/test.hpp +175 -0
- package/thirdparty/pugixml/tests/test_compact.cpp +150 -0
- package/thirdparty/pugixml/tests/test_deprecated.cpp +25 -0
- package/thirdparty/pugixml/tests/test_document.cpp +1910 -0
- package/thirdparty/pugixml/tests/test_dom_modify.cpp +2122 -0
- package/thirdparty/pugixml/tests/test_dom_text.cpp +601 -0
- package/thirdparty/pugixml/tests/test_dom_traverse.cpp +1481 -0
- package/thirdparty/pugixml/tests/test_header_guard.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iosfwd_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iosfwd_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iostream_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_iostream_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_only_1.cpp +21 -0
- package/thirdparty/pugixml/tests/test_header_only_2.cpp +21 -0
- package/thirdparty/pugixml/tests/test_header_string_1.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_string_2.cpp +3 -0
- package/thirdparty/pugixml/tests/test_header_string_iostream.cpp +5 -0
- package/thirdparty/pugixml/tests/test_memory.cpp +303 -0
- package/thirdparty/pugixml/tests/test_parse.cpp +1463 -0
- package/thirdparty/pugixml/tests/test_parse_doctype.cpp +366 -0
- package/thirdparty/pugixml/tests/test_unicode.cpp +152 -0
- package/thirdparty/pugixml/tests/test_version.cpp +5 -0
- package/thirdparty/pugixml/tests/test_write.cpp +757 -0
- package/thirdparty/pugixml/tests/test_xpath.cpp +833 -0
- package/thirdparty/pugixml/tests/test_xpath_api.cpp +646 -0
- package/thirdparty/pugixml/tests/test_xpath_functions.cpp +844 -0
- package/thirdparty/pugixml/tests/test_xpath_operators.cpp +566 -0
- package/thirdparty/pugixml/tests/test_xpath_parse.cpp +428 -0
- package/thirdparty/pugixml/tests/test_xpath_paths.cpp +787 -0
- package/thirdparty/pugixml/tests/test_xpath_paths_abbrev_w3c.cpp +219 -0
- package/thirdparty/pugixml/tests/test_xpath_paths_w3c.cpp +312 -0
- package/thirdparty/pugixml/tests/test_xpath_variables.cpp +683 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_1.cpp +411 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_2.cpp +417 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_3.cpp +321 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_4.cpp +300 -0
- package/thirdparty/pugixml/tests/test_xpath_xalan_5.cpp +295 -0
- package/thirdparty/pugixml/tests/writer_string.cpp +79 -0
- package/thirdparty/pugixml/tests/writer_string.hpp +27 -0
- package/ios/dummy.swift +0 -2
- package/scripts/prepare-openxlsx.js +0 -109
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Copyright 2025 Google LLC
|
|
2
|
+
// Fuzz target for miniz ZIP validation functions
|
|
3
|
+
// Targets: mz_zip_validate_mem_archive (0% coverage, complexity 642)
|
|
4
|
+
// mz_zip_validate_file_archive (0% coverage, complexity 651)
|
|
5
|
+
|
|
6
|
+
#include "miniz.h"
|
|
7
|
+
#include <stdint.h>
|
|
8
|
+
#include <stdlib.h>
|
|
9
|
+
#include <string.h>
|
|
10
|
+
|
|
11
|
+
// Fuzz target for ZIP archive validation
|
|
12
|
+
// Tests both memory-based and file-based validation functions
|
|
13
|
+
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|
14
|
+
if (size < 4) return 0; // Need at least a minimal ZIP header
|
|
15
|
+
|
|
16
|
+
// Test mz_zip_validate_mem_archive - 0% coverage target
|
|
17
|
+
// This validates a ZIP archive in memory
|
|
18
|
+
mz_zip_error zip_error = MZ_ZIP_NO_ERROR;
|
|
19
|
+
mz_bool result = mz_zip_validate_mem_archive(
|
|
20
|
+
data,
|
|
21
|
+
size,
|
|
22
|
+
MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY,
|
|
23
|
+
&zip_error
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// Try with different flags
|
|
27
|
+
zip_error = MZ_ZIP_NO_ERROR;
|
|
28
|
+
mz_zip_validate_mem_archive(data, size, 0, &zip_error);
|
|
29
|
+
|
|
30
|
+
// Test with various buffer sizes to hit edge cases
|
|
31
|
+
if (size > 1024) {
|
|
32
|
+
zip_error = MZ_ZIP_NO_ERROR;
|
|
33
|
+
mz_zip_validate_mem_archive(data, 1024, 0, &zip_error);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Test mz_compress and mz_uncompress - 0% coverage targets
|
|
37
|
+
// These are the simple zlib-compatible API functions
|
|
38
|
+
if (size > 0 && size <= 1024 * 1024) { // Reasonable size limit
|
|
39
|
+
// Compress
|
|
40
|
+
mz_ulong compressed_size = compressBound(size);
|
|
41
|
+
unsigned char* compressed = (unsigned char*)malloc(compressed_size);
|
|
42
|
+
|
|
43
|
+
if (compressed) {
|
|
44
|
+
int compress_result = mz_compress(
|
|
45
|
+
compressed,
|
|
46
|
+
&compressed_size,
|
|
47
|
+
data,
|
|
48
|
+
size
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// If compression succeeded, try decompression
|
|
52
|
+
if (compress_result == MZ_OK && compressed_size > 0) {
|
|
53
|
+
mz_ulong uncompressed_size = size * 2; // Give some headroom
|
|
54
|
+
unsigned char* uncompressed = (unsigned char*)malloc(uncompressed_size);
|
|
55
|
+
|
|
56
|
+
if (uncompressed) {
|
|
57
|
+
mz_uncompress(uncompressed, &uncompressed_size, compressed, compressed_size);
|
|
58
|
+
free(uncompressed);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
free(compressed);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// Test mz_adler32 and mz_crc32 - checksum functions
|
|
67
|
+
mz_adler32(MZ_ADLER32_INIT, data, size);
|
|
68
|
+
mz_crc32(MZ_CRC32_INIT, data, size);
|
|
69
|
+
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Copyright 2025 Google LLC
|
|
2
|
+
// Fuzz target for miniz ZIP writer functions
|
|
3
|
+
// Targets: mz_zip_writer_add_mem (0% coverage, complexity 627)
|
|
4
|
+
// mz_zip_writer_add_mem_ex (0% coverage)
|
|
5
|
+
// mz_zip_writer_add_mem_ex_v2 (0% coverage)
|
|
6
|
+
// mz_zip_writer_finalize_archive (0% coverage)
|
|
7
|
+
|
|
8
|
+
#include "miniz.h"
|
|
9
|
+
#include <stdint.h>
|
|
10
|
+
#include <stdlib.h>
|
|
11
|
+
#include <string.h>
|
|
12
|
+
#include <stdio.h>
|
|
13
|
+
|
|
14
|
+
// Fuzz target for ZIP archive creation and writing
|
|
15
|
+
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|
16
|
+
if (size < 16) return 0; // Need enough data for meaningful test
|
|
17
|
+
|
|
18
|
+
// Create a memory-backed ZIP archive
|
|
19
|
+
mz_zip_archive zip_archive;
|
|
20
|
+
memset(&zip_archive, 0, sizeof(zip_archive));
|
|
21
|
+
|
|
22
|
+
// Initialize the archive with a growable memory buffer
|
|
23
|
+
size_t initial_capacity = size * 2;
|
|
24
|
+
if (!mz_zip_writer_init_heap(&zip_archive, initial_capacity, 0)) {
|
|
25
|
+
return 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Extract parameters from fuzz input
|
|
29
|
+
// First byte determines compression level
|
|
30
|
+
int compression_level = data[0] % 11; // 0-10 (10 = best compression)
|
|
31
|
+
|
|
32
|
+
// Second byte determines flags
|
|
33
|
+
mz_uint flags = data[1];
|
|
34
|
+
|
|
35
|
+
// Rest of data is content to add to ZIP
|
|
36
|
+
const char* filename = "fuzz_test.txt";
|
|
37
|
+
const uint8_t* content = data + 2;
|
|
38
|
+
size_t content_size = size - 2;
|
|
39
|
+
|
|
40
|
+
// Test mz_zip_writer_add_mem - 0% coverage target
|
|
41
|
+
mz_bool add_result = mz_zip_writer_add_mem(
|
|
42
|
+
&zip_archive,
|
|
43
|
+
filename,
|
|
44
|
+
content,
|
|
45
|
+
content_size,
|
|
46
|
+
flags | (compression_level << MZ_ZIP_LDH_BIT_OFFS_SHL)
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
// Add multiple entries with different strategies
|
|
50
|
+
if (content_size > 4) {
|
|
51
|
+
// Add raw (uncompressed) entry
|
|
52
|
+
mz_zip_writer_add_mem(&zip_archive, "raw.bin", content, content_size / 2, 0);
|
|
53
|
+
|
|
54
|
+
// Add compressed entry with store-only flag
|
|
55
|
+
mz_zip_writer_add_mem(
|
|
56
|
+
&zip_archive,
|
|
57
|
+
"stored.bin",
|
|
58
|
+
content + content_size / 2,
|
|
59
|
+
content_size / 2,
|
|
60
|
+
MZ_ZIP_FLAG_STORE
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
// Add with AES encryption flag (may fail without proper setup, but good for fuzzing)
|
|
64
|
+
if (content_size > 8) {
|
|
65
|
+
mz_zip_writer_add_mem(
|
|
66
|
+
&zip_archive,
|
|
67
|
+
"encrypted.bin",
|
|
68
|
+
content + 4,
|
|
69
|
+
content_size - 4,
|
|
70
|
+
MZ_ZIP_FLAG_ENCRYPTED
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Test mz_zip_writer_finalize_archive - 0% coverage target
|
|
76
|
+
mz_zip_writer_finalize_archive(&zip_archive);
|
|
77
|
+
|
|
78
|
+
// Get the final archive data
|
|
79
|
+
void* archive_data = NULL;
|
|
80
|
+
size_t archive_size = 0;
|
|
81
|
+
mz_zip_writer_finalize_heap_archive(&zip_archive, &archive_data, &archive_size);
|
|
82
|
+
|
|
83
|
+
// If we successfully created an archive, try to validate it
|
|
84
|
+
if (archive_data && archive_size > 0) {
|
|
85
|
+
mz_zip_error zip_error = MZ_ZIP_NO_ERROR;
|
|
86
|
+
mz_zip_validate_mem_archive(archive_data, archive_size, 0, &zip_error);
|
|
87
|
+
|
|
88
|
+
// Cleanup
|
|
89
|
+
free(archive_data);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Cleanup the writer
|
|
93
|
+
mz_zip_writer_end(&zip_archive);
|
|
94
|
+
|
|
95
|
+
return 0;
|
|
96
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/bin/bash -eu
|
|
2
|
+
# Copyright 2020 Google Inc.
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
################################################################################
|
|
17
|
+
|
|
18
|
+
# This script is meant to be run by
|
|
19
|
+
# https://github.com/google/oss-fuzz/blob/master/projects/miniz/Dockerfile
|
|
20
|
+
|
|
21
|
+
cat << "EOF" > miniz_export.h
|
|
22
|
+
#ifndef MINIZ_EXPORT
|
|
23
|
+
#define MINIZ_EXPORT
|
|
24
|
+
#endif
|
|
25
|
+
EOF
|
|
26
|
+
|
|
27
|
+
mkdir build
|
|
28
|
+
cd build
|
|
29
|
+
cmake .. -DAMALGAMATE_SOURCES=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_FUZZERS=ON -DBUILD_TESTS=OFF
|
|
30
|
+
make -j$(nproc)
|
|
31
|
+
cd ..
|
|
32
|
+
|
|
33
|
+
zip $OUT/seed_corpus.zip *.*
|
|
34
|
+
|
|
35
|
+
for f in $(find $SRC -name '*_fuzzer.c'); do
|
|
36
|
+
b=$(basename -s .c $f)
|
|
37
|
+
$CC $CFLAGS -Ibuild/amalgamation $f -c -o /tmp/$b.o
|
|
38
|
+
$CXX $CXXFLAGS -stdlib=libc++ -Ibuild/amalgamation /tmp/$b.o -o $OUT/$b $LIB_FUZZING_ENGINE ./build/libminiz.a
|
|
39
|
+
rm -f /tmp/$b.o
|
|
40
|
+
ln -sf $OUT/seed_corpus.zip $OUT/${b}_seed_corpus.zip
|
|
41
|
+
done
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
# Add .zip input file for the zip fuzzer
|
|
45
|
+
rm -f $OUT/zip_fuzzer_seed_corpus.zip
|
|
46
|
+
zip $OUT/zip_fuzzer_seed_corpus.zip $OUT/seed_corpus.zip
|
|
47
|
+
|
|
48
|
+
cp tests/zip.dict $OUT/zip_fuzzer.dict
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
|
|
2
|
+
* see ossfuzz.sh for full license text.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#include <stdio.h>
|
|
6
|
+
#include <stddef.h>
|
|
7
|
+
#include <stdint.h>
|
|
8
|
+
#include <string.h>
|
|
9
|
+
#include <stdlib.h>
|
|
10
|
+
#include <inttypes.h>
|
|
11
|
+
|
|
12
|
+
#include "miniz.h"
|
|
13
|
+
|
|
14
|
+
#define CHECK_ERR(err, msg) \
|
|
15
|
+
{ \
|
|
16
|
+
if (err != Z_OK) \
|
|
17
|
+
{ \
|
|
18
|
+
fprintf(stderr, "%s error: %d\n", msg, err); \
|
|
19
|
+
exit(1); \
|
|
20
|
+
} \
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static const uint8_t *data;
|
|
24
|
+
static size_t dataLen;
|
|
25
|
+
static alloc_func zalloc = NULL;
|
|
26
|
+
static free_func zfree = NULL;
|
|
27
|
+
|
|
28
|
+
/* Test deflate() with small buffers */
|
|
29
|
+
void test_deflate(unsigned char *compr, size_t comprLen)
|
|
30
|
+
{
|
|
31
|
+
z_stream c_stream; /* compression stream */
|
|
32
|
+
int err;
|
|
33
|
+
unsigned long len = dataLen;
|
|
34
|
+
|
|
35
|
+
c_stream.zalloc = zalloc;
|
|
36
|
+
c_stream.zfree = zfree;
|
|
37
|
+
c_stream.opaque = NULL;
|
|
38
|
+
|
|
39
|
+
err = deflateInit(&c_stream, Z_DEFAULT_COMPRESSION);
|
|
40
|
+
CHECK_ERR(err, "deflateInit");
|
|
41
|
+
|
|
42
|
+
c_stream.next_in = (Bytef *)data;
|
|
43
|
+
c_stream.next_out = compr;
|
|
44
|
+
|
|
45
|
+
while (c_stream.total_in != len && c_stream.total_out < comprLen)
|
|
46
|
+
{
|
|
47
|
+
c_stream.avail_in = c_stream.avail_out = 1; /* force small buffers */
|
|
48
|
+
err = deflate(&c_stream, Z_NO_FLUSH);
|
|
49
|
+
CHECK_ERR(err, "deflate small 1");
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Finish the stream, still forcing small buffers: */
|
|
53
|
+
for (;;)
|
|
54
|
+
{
|
|
55
|
+
c_stream.avail_out = 1;
|
|
56
|
+
err = deflate(&c_stream, Z_FINISH);
|
|
57
|
+
if (err == Z_STREAM_END)
|
|
58
|
+
break;
|
|
59
|
+
CHECK_ERR(err, "deflate small 2");
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
err = deflateEnd(&c_stream);
|
|
63
|
+
CHECK_ERR(err, "deflateEnd");
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Test inflate() with small buffers */
|
|
67
|
+
void test_inflate(unsigned char *compr, size_t comprLen, unsigned char *uncompr, size_t uncomprLen)
|
|
68
|
+
{
|
|
69
|
+
int err;
|
|
70
|
+
z_stream d_stream; /* decompression stream */
|
|
71
|
+
|
|
72
|
+
d_stream.zalloc = zalloc;
|
|
73
|
+
d_stream.zfree = zfree;
|
|
74
|
+
d_stream.opaque = NULL;
|
|
75
|
+
|
|
76
|
+
d_stream.next_in = compr;
|
|
77
|
+
d_stream.avail_in = 0;
|
|
78
|
+
d_stream.next_out = uncompr;
|
|
79
|
+
|
|
80
|
+
err = inflateInit(&d_stream);
|
|
81
|
+
CHECK_ERR(err, "inflateInit");
|
|
82
|
+
|
|
83
|
+
while (d_stream.total_out < uncomprLen && d_stream.total_in < comprLen)
|
|
84
|
+
{
|
|
85
|
+
d_stream.avail_in = d_stream.avail_out = 1; /* force small buffers */
|
|
86
|
+
err = inflate(&d_stream, Z_NO_FLUSH);
|
|
87
|
+
if (err == Z_STREAM_END)
|
|
88
|
+
break;
|
|
89
|
+
CHECK_ERR(err, "inflate");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
err = inflateEnd(&d_stream);
|
|
93
|
+
CHECK_ERR(err, "inflateEnd");
|
|
94
|
+
|
|
95
|
+
if (memcmp(uncompr, data, dataLen))
|
|
96
|
+
{
|
|
97
|
+
fprintf(stderr, "bad inflate\n");
|
|
98
|
+
exit(1);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
int LLVMFuzzerTestOneInput(const uint8_t *d, size_t size)
|
|
103
|
+
{
|
|
104
|
+
size_t comprLen = compressBound(size);
|
|
105
|
+
size_t uncomprLen = size;
|
|
106
|
+
uint8_t *compr, *uncompr;
|
|
107
|
+
|
|
108
|
+
/* Discard inputs larger than 1Mb. */
|
|
109
|
+
static size_t kMaxSize = 1024 * 1024;
|
|
110
|
+
|
|
111
|
+
if (size < 1 || size > kMaxSize)
|
|
112
|
+
return 0;
|
|
113
|
+
|
|
114
|
+
data = d;
|
|
115
|
+
dataLen = size;
|
|
116
|
+
compr = calloc(1, comprLen);
|
|
117
|
+
uncompr = calloc(1, uncomprLen);
|
|
118
|
+
|
|
119
|
+
test_deflate(compr, comprLen);
|
|
120
|
+
test_inflate(compr, comprLen, uncompr, uncomprLen);
|
|
121
|
+
|
|
122
|
+
free(compr);
|
|
123
|
+
free(uncompr);
|
|
124
|
+
|
|
125
|
+
return 0;
|
|
126
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// File: timer.cpp - Simple high-precision timer class. Supports Win32, X360, and POSIX/Linux
|
|
2
|
+
#include <stdlib.h>
|
|
3
|
+
#include <stdio.h>
|
|
4
|
+
#include <assert.h>
|
|
5
|
+
#include <time.h>
|
|
6
|
+
|
|
7
|
+
#include "timer.h"
|
|
8
|
+
|
|
9
|
+
#if defined(WIN32)
|
|
10
|
+
#include <windows.h>
|
|
11
|
+
#elif defined(_XBOX)
|
|
12
|
+
#include <xtl.h>
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
unsigned long long timer::g_init_ticks;
|
|
16
|
+
unsigned long long timer::g_freq;
|
|
17
|
+
double timer::g_inv_freq;
|
|
18
|
+
|
|
19
|
+
#if defined(WIN32) || defined(_XBOX)
|
|
20
|
+
inline void query_counter(timer_ticks *pTicks)
|
|
21
|
+
{
|
|
22
|
+
QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(pTicks));
|
|
23
|
+
}
|
|
24
|
+
inline void query_counter_frequency(timer_ticks *pTicks)
|
|
25
|
+
{
|
|
26
|
+
QueryPerformanceFrequency(reinterpret_cast<LARGE_INTEGER*>(pTicks));
|
|
27
|
+
}
|
|
28
|
+
#elif defined(__GNUC__)
|
|
29
|
+
#include <sys/timex.h>
|
|
30
|
+
inline void query_counter(timer_ticks *pTicks)
|
|
31
|
+
{
|
|
32
|
+
struct timeval cur_time;
|
|
33
|
+
gettimeofday(&cur_time, NULL);
|
|
34
|
+
*pTicks = static_cast<unsigned long long>(cur_time.tv_sec)*1000000ULL + static_cast<unsigned long long>(cur_time.tv_usec);
|
|
35
|
+
}
|
|
36
|
+
inline void query_counter_frequency(timer_ticks *pTicks)
|
|
37
|
+
{
|
|
38
|
+
*pTicks = 1000000;
|
|
39
|
+
}
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
timer::timer() :
|
|
43
|
+
m_start_time(0),
|
|
44
|
+
m_stop_time(0),
|
|
45
|
+
m_started(false),
|
|
46
|
+
m_stopped(false)
|
|
47
|
+
{
|
|
48
|
+
if (!g_inv_freq)
|
|
49
|
+
init();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
timer::timer(timer_ticks start_ticks)
|
|
53
|
+
{
|
|
54
|
+
if (!g_inv_freq)
|
|
55
|
+
init();
|
|
56
|
+
|
|
57
|
+
m_start_time = start_ticks;
|
|
58
|
+
|
|
59
|
+
m_started = true;
|
|
60
|
+
m_stopped = false;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
void timer::start(timer_ticks start_ticks)
|
|
64
|
+
{
|
|
65
|
+
m_start_time = start_ticks;
|
|
66
|
+
|
|
67
|
+
m_started = true;
|
|
68
|
+
m_stopped = false;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
void timer::start()
|
|
72
|
+
{
|
|
73
|
+
query_counter(&m_start_time);
|
|
74
|
+
|
|
75
|
+
m_started = true;
|
|
76
|
+
m_stopped = false;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
void timer::stop()
|
|
80
|
+
{
|
|
81
|
+
assert(m_started);
|
|
82
|
+
|
|
83
|
+
query_counter(&m_stop_time);
|
|
84
|
+
|
|
85
|
+
m_stopped = true;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
double timer::get_elapsed_secs() const
|
|
89
|
+
{
|
|
90
|
+
assert(m_started);
|
|
91
|
+
if (!m_started)
|
|
92
|
+
return 0;
|
|
93
|
+
|
|
94
|
+
timer_ticks stop_time = m_stop_time;
|
|
95
|
+
if (!m_stopped)
|
|
96
|
+
query_counter(&stop_time);
|
|
97
|
+
|
|
98
|
+
timer_ticks delta = stop_time - m_start_time;
|
|
99
|
+
return delta * g_inv_freq;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
timer_ticks timer::get_elapsed_us() const
|
|
103
|
+
{
|
|
104
|
+
assert(m_started);
|
|
105
|
+
if (!m_started)
|
|
106
|
+
return 0;
|
|
107
|
+
|
|
108
|
+
timer_ticks stop_time = m_stop_time;
|
|
109
|
+
if (!m_stopped)
|
|
110
|
+
query_counter(&stop_time);
|
|
111
|
+
|
|
112
|
+
timer_ticks delta = stop_time - m_start_time;
|
|
113
|
+
return (delta * 1000000ULL + (g_freq >> 1U)) / g_freq;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
void timer::init()
|
|
117
|
+
{
|
|
118
|
+
if (!g_inv_freq)
|
|
119
|
+
{
|
|
120
|
+
query_counter_frequency(&g_freq);
|
|
121
|
+
g_inv_freq = 1.0f / g_freq;
|
|
122
|
+
|
|
123
|
+
query_counter(&g_init_ticks);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
timer_ticks timer::get_init_ticks()
|
|
128
|
+
{
|
|
129
|
+
if (!g_inv_freq)
|
|
130
|
+
init();
|
|
131
|
+
|
|
132
|
+
return g_init_ticks;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
timer_ticks timer::get_ticks()
|
|
136
|
+
{
|
|
137
|
+
if (!g_inv_freq)
|
|
138
|
+
init();
|
|
139
|
+
|
|
140
|
+
timer_ticks ticks;
|
|
141
|
+
query_counter(&ticks);
|
|
142
|
+
return ticks - g_init_ticks;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
double timer::ticks_to_secs(timer_ticks ticks)
|
|
146
|
+
{
|
|
147
|
+
if (!g_inv_freq)
|
|
148
|
+
init();
|
|
149
|
+
|
|
150
|
+
return ticks * g_inv_freq;
|
|
151
|
+
}
|
|
152
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// File: timer.h
|
|
2
|
+
#pragma once
|
|
3
|
+
|
|
4
|
+
typedef unsigned long long timer_ticks;
|
|
5
|
+
|
|
6
|
+
class timer
|
|
7
|
+
{
|
|
8
|
+
public:
|
|
9
|
+
timer();
|
|
10
|
+
timer(timer_ticks start_ticks);
|
|
11
|
+
|
|
12
|
+
void start();
|
|
13
|
+
void start(timer_ticks start_ticks);
|
|
14
|
+
|
|
15
|
+
void stop();
|
|
16
|
+
|
|
17
|
+
double get_elapsed_secs() const;
|
|
18
|
+
inline double get_elapsed_ms() const { return get_elapsed_secs() * 1000.0f; }
|
|
19
|
+
timer_ticks get_elapsed_us() const;
|
|
20
|
+
|
|
21
|
+
static void init();
|
|
22
|
+
static inline timer_ticks get_ticks_per_sec() { return g_freq; }
|
|
23
|
+
static timer_ticks get_init_ticks();
|
|
24
|
+
static timer_ticks get_ticks();
|
|
25
|
+
static double ticks_to_secs(timer_ticks ticks);
|
|
26
|
+
static inline double ticks_to_ms(timer_ticks ticks) { return ticks_to_secs(ticks) * 1000.0f; }
|
|
27
|
+
static inline double get_secs() { return ticks_to_secs(get_ticks()); }
|
|
28
|
+
static inline double get_ms() { return ticks_to_ms(get_ticks()); }
|
|
29
|
+
|
|
30
|
+
private:
|
|
31
|
+
static timer_ticks g_init_ticks;
|
|
32
|
+
static timer_ticks g_freq;
|
|
33
|
+
static double g_inv_freq;
|
|
34
|
+
|
|
35
|
+
timer_ticks m_start_time;
|
|
36
|
+
timer_ticks m_stop_time;
|
|
37
|
+
|
|
38
|
+
bool m_started : 1;
|
|
39
|
+
bool m_stopped : 1;
|
|
40
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
|
|
2
|
+
* see ossfuzz.sh for full license text.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#include <stddef.h>
|
|
6
|
+
#include <stdint.h>
|
|
7
|
+
#include <string.h>
|
|
8
|
+
|
|
9
|
+
#include "miniz.h"
|
|
10
|
+
|
|
11
|
+
static unsigned char buffer[256 * 1024] = { 0 };
|
|
12
|
+
|
|
13
|
+
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|
14
|
+
{
|
|
15
|
+
unsigned long int buffer_length = sizeof(buffer);
|
|
16
|
+
|
|
17
|
+
if (Z_OK != uncompress2(buffer, &buffer_length, data, &size))
|
|
18
|
+
return 0;
|
|
19
|
+
|
|
20
|
+
return 0;
|
|
21
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* Derived from zlib fuzzers at http://github.com/google/oss-fuzz/tree/master/projects/zlib,
|
|
2
|
+
* see ossfuzz.sh for full license text.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#include <stddef.h>
|
|
6
|
+
#include <stdint.h>
|
|
7
|
+
#include <string.h>
|
|
8
|
+
|
|
9
|
+
#include "miniz.h"
|
|
10
|
+
|
|
11
|
+
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|
12
|
+
{
|
|
13
|
+
unsigned long int buffer_length = 1;
|
|
14
|
+
unsigned char *buffer = NULL;
|
|
15
|
+
int z_status = 0;
|
|
16
|
+
|
|
17
|
+
if (size > 0)
|
|
18
|
+
buffer_length *= data[0];
|
|
19
|
+
if (size > 1)
|
|
20
|
+
buffer_length *= data[1];
|
|
21
|
+
|
|
22
|
+
buffer = (unsigned char *)malloc(buffer_length);
|
|
23
|
+
|
|
24
|
+
z_status = uncompress(buffer, &buffer_length, data, size);
|
|
25
|
+
free(buffer);
|
|
26
|
+
|
|
27
|
+
if (Z_OK != z_status)
|
|
28
|
+
return 0;
|
|
29
|
+
return 0;
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Fuzzing dictionary for .zip files
|
|
2
|
+
|
|
3
|
+
header_lfh="\x50\x4b\x03\x04"
|
|
4
|
+
header_cd="\x50\x4b\x01\x02"
|
|
5
|
+
header_eocd="\x50\x4b\x05\x06"
|
|
6
|
+
header_eocd64="\x50\x4b\x06\x06"
|
|
7
|
+
data_descriptor="\x50\x4b\x07\x08"
|
|
8
|
+
extra_data_sig="\x50\x4b\x06\x08"
|
|
9
|
+
digital_sig="\x50\x4b\x05\x05"
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#include <stdint.h>
|
|
2
|
+
#include <inttypes.h>
|
|
3
|
+
|
|
4
|
+
#include "miniz.h"
|
|
5
|
+
|
|
6
|
+
static char filename[260];
|
|
7
|
+
static unsigned char read_buf[1024 * 256];
|
|
8
|
+
|
|
9
|
+
static const size_t filename_max = sizeof(filename);
|
|
10
|
+
static const size_t read_buf_size = sizeof(read_buf);
|
|
11
|
+
static const size_t data_max = 1024 * 256;
|
|
12
|
+
|
|
13
|
+
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
|
|
14
|
+
{
|
|
15
|
+
if (size > data_max)
|
|
16
|
+
return 0;
|
|
17
|
+
|
|
18
|
+
int ret = 0;
|
|
19
|
+
mz_zip_archive zip;
|
|
20
|
+
mz_zip_zero_struct(&zip);
|
|
21
|
+
|
|
22
|
+
mz_uint flags = 0;
|
|
23
|
+
|
|
24
|
+
if (!mz_zip_reader_init_mem(&zip, data, size, flags))
|
|
25
|
+
return 0;
|
|
26
|
+
|
|
27
|
+
mz_uint i, files;
|
|
28
|
+
|
|
29
|
+
files = mz_zip_reader_get_num_files(&zip);
|
|
30
|
+
|
|
31
|
+
for (i = 0; i < files; i++)
|
|
32
|
+
{
|
|
33
|
+
mz_zip_clear_last_error(&zip);
|
|
34
|
+
|
|
35
|
+
if (mz_zip_reader_is_file_a_directory(&zip, i))
|
|
36
|
+
continue;
|
|
37
|
+
|
|
38
|
+
mz_zip_validate_file(&zip, i, MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY);
|
|
39
|
+
|
|
40
|
+
if (mz_zip_reader_is_file_encrypted(&zip, i))
|
|
41
|
+
continue;
|
|
42
|
+
|
|
43
|
+
mz_zip_clear_last_error(&zip);
|
|
44
|
+
|
|
45
|
+
mz_uint ret = mz_zip_reader_get_filename(&zip, i, filename, filename_max);
|
|
46
|
+
|
|
47
|
+
if (mz_zip_get_last_error(&zip))
|
|
48
|
+
continue;
|
|
49
|
+
|
|
50
|
+
mz_zip_archive_file_stat file_stat = { 0 };
|
|
51
|
+
mz_bool status = mz_zip_reader_file_stat(&zip, i, &file_stat) != 0;
|
|
52
|
+
|
|
53
|
+
if ((file_stat.m_method) && (file_stat.m_method != MZ_DEFLATED))
|
|
54
|
+
continue;
|
|
55
|
+
|
|
56
|
+
mz_zip_reader_extract_file_to_mem(&zip, file_stat.m_filename, read_buf, read_buf_size, 0);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
cleanup:
|
|
60
|
+
mz_zip_reader_end(&zip);
|
|
61
|
+
|
|
62
|
+
return ret;
|
|
63
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
tests/data/* -text
|