summaryrefslogtreecommitdiffstats
path: root/tests/libfuzzer
Commit message (Collapse)AuthorAgeFilesLines
* Add license headers to cmake filesLucie Gérard5 days14-0/+42
| | | | | | | | | | | | CMakeLists.txt and .cmake files of significant size (more than 2 lines according to our check in tst_license.pl) now have the copyright and license header. Existing copyright statements remain intact Task-number: QTBUG-88621 Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1614-378/+28
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fuzzing: Add fuzzer for QJsonDocument::fromJsonRobert Löhning2022-01-172-0/+61
| | | | | | | Task-number: QTBUG-99799 Change-Id: If997b661da2fce04b84f94b9e66de19c9946a914 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fuzzing: Don't explicitly restrict sizes before loading imagesRobert Löhning2022-01-121-11/+2
| | | | | | | | | | | | | | Since Qt 6.0, QImageIOHandlers by default take care of this themselves by not allocating more than 128 MiB for an image. This change will not significantly reduce code coverage of the fuzzer because QImage::loadFromData() calls QImageReader::read() which does everything QImageReader::size() does except for returning the read size in the end. On the other hand, it will speed up the execution because the same image will not be read twice by different QImageReaders anymore. Change-Id: Iab63d9e5ec02fbe5765fbf7ccb0b82896ec37692 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Tests: Use REQUIRED COMPONENTS in find_package(Qt6...)Kai Köhne2021-12-1313-19/+13
| | | | | | | | | Make sure configure fails early if a component cannot be found. Task-number: QTBUG-98867 Pick-to: 6.2 6.3 Change-Id: I4baa35a84342df58ce8932601fb602be92ed5ab9 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Bump almost all cmake_minimum_required calls to 3.16Alexandru Croitor2021-09-2213-13/+13
| | | | | | | | | | | | Needed for subsequent change that will check and error out if the version is lower than 3.16. We do that to ensure all policies introduced by CMake up to version 3.16 have their behavior set to NEW. Pick-to: 6.2 Task-number: QTBUG-95018 Change-Id: Ieaf82c10987dd797d86a3fd4a986a67e72de486a Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Fuzzing: Discard more logging output from QSslCertificateRobert Löhning2021-08-301-1/+1
| | | | | | | When linked to OpenSSL, qt.tlsbackend.ossl will log. Change-Id: I6f0e3c3e6af73b29cff93b8efe39933e5b36d493 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fuzzing: Remove .pro-files of libfuzzer testsRobert Löhning2021-08-2413-127/+0
| | | | | | | | | They were replaced by CMake files and oss-fuzz was updated to use the latter. No need to still maintain qmake based builds. Change-Id: If38f39c23ef3a58c33c428341486b62fd0a81888 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove dysfunctional -coverage configure argumentJoerg Bornemann2021-08-101-1/+1
| | | | | | | | | | | | | | The -coverage argument merely added compiler flags for the Qt build. It was never properly ported to the CMake build, and it doesn't seem feasible to have configure arguments for every possible compiler option. The same can be achieved by passing the needed compiler option to CMake, for example: CMAKE_CXX_FLAGS=-fsanitize-coverage=trace-pc-guard Pick-to: 6.2 Fixes: QTBUG-86227 Change-Id: Ieef9acaedc0a839f9fb35b4403395eea28643864 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fuzzing: Guide the compiler to the right ctor of QCalendarRobert Löhning2021-07-261-1/+1
| | | | | Change-Id: I4e828f6ce33636eaef4f51e94e0879d735736ef1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* fuzzing: Add instructions how to reproduce issues from oss-fuzzRobert Löhning2021-06-161-1/+23
| | | | | | Change-Id: I278516f527990b3c4477436a82695e68b5f6a713 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fuzzing: Discard logging output from QSslCertificateRobert Löhning2021-05-311-0/+4
| | | | | | | It's pointless in a fuzzer and slows down execution. Change-Id: I0d36ed8814cf8fb332c196ea7e24eae8ee4d3c6e Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Fuzzing: Discard logging output from QTextDocumentRobert Löhning2021-05-312-2/+12
| | | | | | | It's pointless in a fuzzer and slows down execution. Change-Id: I160d7fd761118f9eba9b98fc024aef293e021845 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fuzzing: Add CMake project files for fuzz targetsRobert Löhning2021-05-3113-108/+344
| | | | | Change-Id: Ied44bfd2c83d5590066146187a7333b677ceb179 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fuzzing: Test different calendar systemsRobert Löhning2021-04-261-1/+5
| | | | | Change-Id: I61be9f09d4299674e9cf9daf1d4dbbf90f3d2d2d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fuzzing: Simplify figuring out the failing datetime formatRobert Löhning2021-04-121-0/+9
| | | | | | Task-number: QTBUG-92275 Change-Id: I732e72e614163b536c3fa9187011c57fea639b92 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fuzzing: Provide link to oss-fuzzRobert Loehning2020-12-111-1/+13
| | | | | | | Change-Id: Iac77faac8bd901504073b1aacd067a42e349eca3 Pick-to: 5.15 6.0 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fuzzing: Add a test for QDateTime::fromStringEdward Welbourne2020-11-192-0/+110
| | | | | | | | | | This patch adds a basic fuzzing test for QDateTime::fromString. Task-number: QTBUG-87104 Pick-to: 5.15 Change-Id: Icc51386f06f6d4d2a4495734f7fa45de80c6e065 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-09-235-15/+15
| | | | | | | | | | | Modify special case locations to use the new API as well. Clean up some stale .prev files that are not needed anymore. Clean up some project files that are not used anymore. Task-number: QTBUG-86815 Change-Id: I9947da921f98686023c6bb053dfcc101851276b5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-071-1/+1
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fuzzing: Add fuzz target for QCryptographicHash::resultRobert Loehning2020-06-262-0/+50
| | | | | | | Pick-to: 5.15 Change-Id: Ifc12358dd8cb932fe62c13975554d753a4f1afd9 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fuzzing: Test svg imagesRobert Loehning2020-06-191-0/+3
| | | | | | Pick-to: 5.15 Change-Id: I1467d07eaaa1233417cd3a18fd65ec3322181984 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Fuzzing: Don't try to load huge valid imagesRobert Loehning2020-06-151-1/+10
| | | | | | | | | They are justified in using huge memory. Pick-to: 5.15 Change-Id: Id16d2ea67cfac0e031d05258173391e222b41097 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fuzzing: Add fuzz target for QImage::loadFromDataRobert Loehning2020-05-192-0/+55
| | | | | | | Pick-to: 5.15 Change-Id: Ie67eb9be80fe42d463c566c728c73c9c92c2081b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-224-0/+92
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/widgets/qabstractbutton.cpp src/widgets/widgets/qbuttongroup.cpp src/widgets/widgets/qbuttongroup.h src/widgets/widgets/qsplashscreen.cpp tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp tests/benchmarks/opengl/main.cpp Needed update: src/plugins/platforms/cocoa/CMakeLists.txt Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
| * Fuzzing: Add fuzz target for QCborStreamReader::nextRobert Loehning2020-04-162-0/+46
| | | | | | | | | | Change-Id: I8e7d90d89b66395370809935b1cb5bf144bded49 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Fuzzing: Add fuzz target for QTextStream's extraction operatorRobert Loehning2020-04-142-0/+46
| | | | | | | | | | Change-Id: Ia5fa2e36f5439ebcc323d6d18c33c2dd58404aba Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-0815-13/+230
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/doc/src/cube.qdoc src/corelib/global/qlibraryinfo.cpp src/corelib/text/qbytearray_p.h src/corelib/text/qlocale_data_p.h src/corelib/time/qhijricalendar_data_p.h src/corelib/time/qjalalicalendar_data_p.h src/corelib/time/qromancalendar_data_p.h src/network/ssl/qsslcertificate.h src/widgets/doc/src/graphicsview.qdoc src/widgets/widgets/qcombobox.cpp src/widgets/widgets/qcombobox.h tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro tests/manual/diaglib/debugproxystyle.cpp tests/manual/diaglib/qwidgetdump.cpp tests/manual/diaglib/qwindowdump.cpp tests/manual/diaglib/textdump.cpp util/locale_database/cldr2qlocalexml.py util/locale_database/qlocalexml.py util/locale_database/qlocalexml2cpp.py Resolution of util/locale_database/ are based on: https://codereview.qt-project.org/c/qt/qtbase/+/294250 and src/corelib/{text,time}/*_data_p.h were then regenerated by running those scripts. Updated CMakeLists.txt in each of tests/auto/corelib/serialization/qcborstreamreader/ tests/auto/corelib/serialization/qcborvalue/ tests/auto/gui/kernel/ and generated new ones in each of tests/auto/gui/kernel/qaddpostroutine/ tests/auto/gui/kernel/qhighdpiscaling/ tests/libfuzzer/corelib/text/qregularexpression/optimize/ tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/ tests/libfuzzer/gui/text/qtextdocument/sethtml/ tests/libfuzzer/gui/text/qtextdocument/setmarkdown/ tests/libfuzzer/gui/text/qtextlayout/beginlayout/ by running util/cmake/pro2cmake.py on their changed .pro files. Changed target name in tests/auto/gui/kernel/qaction/qaction.pro tests/auto/gui/kernel/qaction/qactiongroup.pro tests/auto/gui/kernel/qshortcut/qshortcut.pro to ensure unique target names for CMake Changed tst_QComboBox::currentIndex to not test the currentIndexChanged(QString), as that one does not exist in Qt 6 anymore. Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
| * Fuzzing: ignore logging output from QColorSpaceRobert Loehning2020-03-301-4/+6
| | | | | | | | | | Change-Id: Ica549be24c8873854934f4ba24f2b3f7cb077e25 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Fuzzing: Add QGuiApplication to gui fuzz targetsRobert Loehning2020-03-308-9/+34
| | | | | | | | | | Change-Id: I3713701f63d9d8938fbb42ad1ae2f0c4ae813e94 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Fuzzing: Add fuzz target for QRegularExpression::optimizeRobert Loehning2020-03-252-0/+43
|/ | | | | | Change-Id: I693af83caed60cdffc83af368a15567d72524844 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fuzzing: Add fuzz target for ctor of QSslCertificateRobert Loehning2020-03-132-0/+45
| | | | | | | Change-Id: I483f17e7cb6108e5096cf57594183a206f605fbc Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fuzzing: Add fuzz target for QCborValue::fromCborRobert Loehning2020-02-272-0/+44
| | | | | | | Change-Id: I59fbab99849a23c553520db33d6c7182dc7b114d Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fuzzing: Follow style of having lower case namesRobert Loehning2020-02-136-0/+0
| | | | | | Change-Id: If33d9cf67fa13aa6a813b1f545c19dabe2fbb59d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fuzzing: Move fuzz target to match path of tested codeRobert Loehning2020-01-072-0/+0
| | | | | Change-Id: I3e96f5ba89e9126ff8626f0e98397ad996fb1cd3 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fuzzing: Allow linking to other fuzzing enginesRobert Loehning2020-01-035-5/+30
| | | | | | | | | | | oss-fuzz sets the environment variable LIB_FUZZING_ENGINE to link with AFL or libFuzzer. If this variable is not set, libFuzzer will be used as before, only that the right qmake variable will be used for doing so. Change-Id: If9fe7739a8d2d4a76f4633a75cad3d2e935f3b61 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-231-1/+2
|\ | | | | | | Change-Id: I1c68f2f6bc35d344c60a1898b68bf2ca79e54a9d
| * Fuzzing: Update location of testcases in ReadmeRobert Loehning2019-11-211-1/+2
| | | | | | | | | | | | | | At the time of writing, they were still planned to be in qtbase. Change-Id: I27cba2bbd176d930990270ea68f077ec6e0a2d5b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-11-151-0/+4
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/gui/rhi/qshader.cpp tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp Change-Id: I1c4ae718eb3592a0a0a90af9d11553f3ab68cad5
| * Fuzzing: Add comment how to recude noise in iccparser's fuzzerRobert Loehning2019-11-131-0/+4
| | | | | | | | | | | | | | | | | | With logging enabled, all the output will slow down execution and fill up your hard disc in about a day. Task-number: QTBUG-79050 Change-Id: I5dcac2f349f7dbe471a5e6dd7006b89d312aeeaf Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | configure: Add sanitizer "fuzzer-no-link"Robert Loehning2019-11-141-0/+2
|/ | | | | | | | | | | Adds instrumentation for fuzzing to the binaries but links to the usual main function instead of a fuzzer's. The similar sanitizer "fuzzer" should then be used only for building the test itself. Requires clang 6 or higher. Change-Id: I24ee1f018b0b97f2977dc86fbdc29a164d7c4e01 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fuzzing: Don't copy input data to QByteArrayRobert Loehning2019-10-094-4/+4
| | | | | Change-Id: I603413805dca46a85709c2ab6ff573687849572e Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Add libfuzzer test for QTextLayout::beginLayout()Robert Loehning2019-10-072-0/+39
| | | | | | Task-number: QTBUG-77819 Change-Id: I34e9cbaa615896222bcf947012cfed9f6c3186c7 Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
* Add libfuzzer test for QTextDocument::setMarkdown()Robert Loehning2019-10-042-0/+38
| | | | | | Change-Id: I729d4a3bb276523011a6f17a800e72aa34540e47 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Harden ICC parserAllan Sandfeld Jensen2019-07-312-0/+40
| | | | | | | | | | | Add missing implicit size checks of tags by passing the already checked explicitly given size forward. Also adds my fuzzing test for the ICC parser as it is security critical, by being used by multiple image formats. Change-Id: Ieb632ccb78f9b445a276959ffbd66fa04a7a5b45 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix typos in readmeRobert Loehning2019-07-111-3/+3
| | | | | | Change-Id: Ifecb1bac475512241de9bcf195955409bb3adaff Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Improve project files of libfuzzer testsRobert Loehning2019-03-133-5/+6
| | | | | Change-Id: I7977beb1bbc142326a3cc48435b91ec7293e2cff Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add libfuzzer test for QTextDocument::setHtml()Robert Loehning2019-01-242-0/+41
| | | | | Change-Id: I88d634841906cdf7994ea05d80caf586c2dec02a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add libfuzzer test for QXmlStreamReader::readNext()Robert Loehning2019-01-243-0/+78
Change-Id: I8a15057954dbb09200bcef8a89a8008e0e9fad9c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>