qt 6.5.1 original

This commit is contained in:
kleuter
2023-10-29 23:33:08 +01:00
parent 71d22ab6b0
commit 85d238dfda
21202 changed files with 5499099 additions and 0 deletions

View File

@ -0,0 +1,30 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(next LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_add_executable(next
main.cpp
)
target_link_libraries(next PUBLIC
Qt::Core
)
if(DEFINED ENV{LIB_FUZZING_ENGINE})
target_link_libraries(next PRIVATE
$ENV{LIB_FUZZING_ENGINE}
)
else()
target_link_libraries(next PRIVATE
-fsanitize=fuzzer
)
endif()

View File

@ -0,0 +1,11 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QCborStreamReader>
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
QCborStreamReader reader(QByteArray::fromRawData(Data, Size));
while (reader.isValid())
reader.next(1024);
return 0;
}

View File

@ -0,0 +1,30 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(fromcbor LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_add_executable(fromcbor
main.cpp
)
target_link_libraries(fromcbor PUBLIC
Qt::Core
)
if(DEFINED ENV{LIB_FUZZING_ENGINE})
target_link_libraries(fromcbor PRIVATE
$ENV{LIB_FUZZING_ENGINE}
)
else()
target_link_libraries(fromcbor PRIVATE
-fsanitize=fuzzer
)
endif()

View File

@ -0,0 +1,9 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QCborValue>
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
QCborValue::fromCbor(QByteArray::fromRawData(Data, Size));
return 0;
}

View File

@ -0,0 +1,30 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(fromjson LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_add_executable(fromjson
main.cpp
)
target_link_libraries(fromjson PUBLIC
Qt::Core
)
if(DEFINED ENV{LIB_FUZZING_ENGINE})
target_link_libraries(fromjson PRIVATE
$ENV{LIB_FUZZING_ENGINE}
)
else()
target_link_libraries(fromjson PRIVATE
-fsanitize=fuzzer
)
endif()

View File

@ -0,0 +1,9 @@
// Copyright (C) 2022 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QJsonDocument>
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
QJsonDocument::fromJson(QByteArray::fromRawData(Data, Size));
return 0;
}

View File

@ -0,0 +1,30 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(extractionoperator-float LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_add_executable(extractionoperator-float
main.cpp
)
target_link_libraries(extractionoperator-float PUBLIC
Qt::Core
)
if(DEFINED ENV{LIB_FUZZING_ENGINE})
target_link_libraries(extractionoperator-float PRIVATE
$ENV{LIB_FUZZING_ENGINE}
)
else()
target_link_libraries(extractionoperator-float PRIVATE
-fsanitize=fuzzer
)
endif()

View File

@ -0,0 +1,11 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QTextStream>
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
QTextStream qts(QByteArray::fromRawData(Data, Size));
float f;
qts >> f;
return 0;
}

View File

@ -0,0 +1,30 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(readnext LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_add_executable(readnext
main.cpp
)
target_link_libraries(readnext PUBLIC
Qt::Core
)
if(DEFINED ENV{LIB_FUZZING_ENGINE})
target_link_libraries(readnext PRIVATE
$ENV{LIB_FUZZING_ENGINE}
)
else()
target_link_libraries(readnext PRIVATE
-fsanitize=fuzzer
)
endif()

View File

@ -0,0 +1,11 @@
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QXmlStreamReader>
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
QXmlStreamReader reader(QByteArray::fromRawData(Data, Size));
while (!reader.atEnd())
reader.readNext();
return 0;
}

View File

@ -0,0 +1,30 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(optimize LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_add_executable(optimize
main.cpp
)
target_link_libraries(optimize PUBLIC
Qt::Core
)
if(DEFINED ENV{LIB_FUZZING_ENGINE})
target_link_libraries(optimize PRIVATE
$ENV{LIB_FUZZING_ENGINE}
)
else()
target_link_libraries(optimize PRIVATE
-fsanitize=fuzzer
)
endif()

View File

@ -0,0 +1,10 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QRegularExpression>
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
QRegularExpression qre(QByteArray::fromRawData(Data, Size));
qre.optimize();
return 0;
}

View File

@ -0,0 +1,30 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(fromstring LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_add_executable(fromstring
main.cpp
)
target_link_libraries(fromstring PUBLIC
Qt::Core
)
if(DEFINED ENV{LIB_FUZZING_ENGINE})
target_link_libraries(fromstring PRIVATE
$ENV{LIB_FUZZING_ENGINE}
)
else()
target_link_libraries(fromstring PRIVATE
-fsanitize=fuzzer
)
endif()

View File

@ -0,0 +1,88 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QDateTime>
// Enable to report the currently used format, e.g. when reproducing issues
// #define LOG_FORMAT
#ifdef LOG_FORMAT
#include <QDebug>
#endif
static const QString formats[] = {
QStringLiteral("M/d/yyyy"),
QStringLiteral("h"),
QStringLiteral("hh"),
QStringLiteral("H"),
QStringLiteral("HH"),
QStringLiteral("m"),
QStringLiteral("mm"),
QStringLiteral("s"),
QStringLiteral("ss"),
QStringLiteral("z"),
QStringLiteral("zzz"),
QStringLiteral("A"),
QStringLiteral("t"),
QStringLiteral("M/d/yyyy hh:mm"),
QStringLiteral("M/d/yyyy hh:mm A"),
QStringLiteral("M/d/yyyy, hh:mm"),
QStringLiteral("M/d/yyyy, hh:mm A"),
QStringLiteral("MMM d yyyy"),
QStringLiteral("MMM d yyyy hh:mm"),
QStringLiteral("MMM d yyyy hh:mm:ss"),
QStringLiteral("MMM d yyyy, hh:mm"),
QStringLiteral("MMM d yyyy, hh:mm:ss"),
QStringLiteral("MMMM d yyyy"),
QStringLiteral("MMMM d yyyy hh:mm"),
QStringLiteral("MMMM d yyyy hh:mm:ss"),
QStringLiteral("MMMM d yyyy, hh:mm"),
QStringLiteral("MMMM d yyyy, hh:mm:ss"),
QStringLiteral("MMMM d yyyy, hh:mm:ss t"),
QStringLiteral("MMM d, yyyy"),
QStringLiteral("MMM d, yyyy hh:mm"),
QStringLiteral("MMM d, yyyy hh:mm:ss"),
QStringLiteral("MMMM d, yyyy"),
QStringLiteral("MMMM d, yyyy hh:mm"),
QStringLiteral("MMMM d, yyyy hh:mm:ss"),
QStringLiteral("MMMM d, yyyy hh:mm:ss t"),
QStringLiteral("d MMM yyyy"),
QStringLiteral("d MMM yyyy hh:mm"),
QStringLiteral("d MMM yyyy hh:mm:ss"),
QStringLiteral("d MMM yyyy, hh:mm"),
QStringLiteral("d MMM yyyy, hh:mm:ss"),
QStringLiteral("d MMMM yyyy"),
QStringLiteral("d MMMM yyyy hh:mm"),
QStringLiteral("d MMMM yyyy hh:mm:ss"),
QStringLiteral("d MMMM yyyy, hh:mm"),
QStringLiteral("d MMMM yyyy, hh:mm:ss"),
QStringLiteral("d MMM, yyyy"),
QStringLiteral("d MMM, yyyy hh:mm"),
QStringLiteral("d MMM, yyyy hh:mm:ss"),
QStringLiteral("d MMMM, yyyy"),
QStringLiteral("d MMMM, yyyy hh:mm"),
QStringLiteral("d MMMM, yyyy hh:mm:ss"),
QStringLiteral("yyyy-MM-ddThh:mm:ss.zt"),
};
// libFuzzer entry-point for testing QDateTimeParser
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size)
{
const QString userString = QString::fromUtf8(Data, Size);
QDateTime::fromString(userString, Qt::TextDate);
QDateTime::fromString(userString, Qt::ISODate);
QDateTime::fromString(userString, Qt::RFC2822Date);
QDateTime::fromString(userString, Qt::ISODateWithMs);
QDateTime::fromString(userString, formats[0], QCalendar(QCalendar::System::Gregorian));
for (int sys = int(QCalendar::System::Julian); sys <= int(QCalendar::System::Last); ++sys)
QDateTime::fromString(userString, formats[0], QCalendar(QCalendar::System(sys)));
for (const auto &format : formats) {
#ifdef LOG_FORMAT
qDebug() << "Trying format:" << format;
#endif
QDateTime::fromString(userString, format);
}
return 0;
}

View File

@ -0,0 +1,30 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
cmake_minimum_required(VERSION 3.16)
project(result LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
find_package(Qt6 REQUIRED COMPONENTS Core)
qt_add_executable(result
main.cpp
)
target_link_libraries(result PUBLIC
Qt::Core
)
if(DEFINED ENV{LIB_FUZZING_ENGINE})
target_link_libraries(result PRIVATE
$ENV{LIB_FUZZING_ENGINE}
)
else()
target_link_libraries(result PRIVATE
-fsanitize=fuzzer
)
endif()

View File

@ -0,0 +1,15 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QCryptographicHash>
extern "C" int LLVMFuzzerTestOneInput(const char *Data, size_t Size) {
for (QCryptographicHash::Algorithm algo = QCryptographicHash::Md4;
algo <= QCryptographicHash::RealSha3_512;
algo = QCryptographicHash::Algorithm(algo + 1)) {
QCryptographicHash qh(algo);
qh.addData(QByteArray::fromRawData(Data, Size));
qh.result();
}
return 0;
}