diff --git a/CMakeLists.txt b/CMakeLists.txt index 21ae7d304..f800348c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,321 +1,321 @@ project(k3b) cmake_minimum_required(VERSION 2.8.12) find_package(ECM REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH "${ECM_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") # KDE Application Version, managed by release script set (KDE_APPLICATIONS_VERSION_MAJOR "18") set (KDE_APPLICATIONS_VERSION_MINOR "03") set (KDE_APPLICATIONS_VERSION_MICRO "70") set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}") set (QT_MIN_VERSION "5.5.0") set (KF5_MIN_VERSION "5.21.0") ################## K3b version ################################ set(K3B_VERSION_STRING ${KDE_APPLICATIONS_VERSION}) # increase on BC breakage set(K3B_LIB_VERSION_MAJOR 7) # increase after adding functionality set(K3B_LIB_VERSION_MINOR 0) set(K3B_LIB_VERSION_RELEASE 0) ################## K3b options ################################# option(K3B_DEBUG "K3b additional debugging support" OFF) if(K3B_DEBUG) add_definitions(-g) endif() option(K3B_ENABLE_MUSICBRAINZ "Support for querying metadata about audio tracks from Musicbrainz." ON) option(K3B_ENABLE_DVD_RIPPING "Support for ripping Video DVDs with optional decryption." ON) option(K3B_ENABLE_TAGLIB "Support for reading audio file metadata using Taglib." ON) option(K3B_BUILD_API_DOCS "Build the API documentation for the K3b libs." OFF) option(K3B_ENABLE_PERMISSION_HELPER "Build the permissions helper program" OFF) # plugin options option(K3B_BUILD_FFMPEG_DECODER_PLUGIN "Build FFmpeg decoder plugin" ON) option(K3B_BUILD_OGGVORBIS_DECODER_PLUGIN "Build Ogg-Vorbis decoder plugin" ON) option(K3B_BUILD_OGGVORBIS_ENCODER_PLUGIN "Build Ogg-Vorbis encoder plugin" ON) option(K3B_BUILD_MAD_DECODER_PLUGIN "Build MAD mp3 decoder plugin" ON) option(K3B_BUILD_MUSE_DECODER_PLUGIN "Build Musepack decoder plugin" ON) option(K3B_BUILD_FLAC_DECODER_PLUGIN "Build Flac decoder plugin" ON) option(K3B_BUILD_SNDFILE_DECODER_PLUGIN "Build libsndfile decoder plugin" ON) option(K3B_BUILD_LAME_ENCODER_PLUGIN "Build Lame encoder plugin" ON) option(K3B_BUILD_SOX_ENCODER_PLUGIN "Build Sox encoder plugin" ON) option(K3B_BUILD_EXTERNAL_ENCODER_PLUGIN "Build external app encoder plugin" ON) option(K3B_BUILD_WAVE_DECODER_PLUGIN "Build Wave decoder plugin" ON) ################## K3b requirements ################################# include(KDEInstallDirs) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) include(FeatureSummary) include(GenerateExportHeader) include(ECMInstallIcons) include(ECMEnableSanitizers) find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core DBus Gui) find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Archive Config CoreAddons DocTools FileMetaData I18n IconThemes JobWidgets KCMUtils KIO Notifications NewStuff NotifyConfig Service Solid WidgetsAddons XmlGui) find_package(Qt5WebKitWidgets) set_package_properties(Qt5WebKitWidgets PROPERTIES DESCRIPTION "Qt5WebKitWidgets is used for prettier k3bdiskinfoview." TYPE OPTIONAL) if(Qt5WebKitWidgets_FOUND) add_definitions(-DHAVE_QT5WEBKITWIDGETS) endif() add_definitions(-DQT_NO_URL_CAST_FROM_STRING) option(WITH_NEW_SOLID_JOB "WIP: base Job class" Off) add_feature_info(Solid::Job WITH_NEW_SOLID_JOB "WIP: Base class for Solid Asynchronous apis") if(WITH_NEW_SOLID_JOB) add_definitions(-DWITH_NEW_SOLID_JOB) endif() find_package(Iconv) set(HAVE_ICONV "${ICONV_FOUND}") find_package(Samplerate) set_package_properties(Samplerate PROPERTIES DESCRIPTION "Audio sampling rate conversion." URL "http://www.mega-nerd.com/SRC" TYPE REQUIRED) find_package(KF5Cddb) set_package_properties(KF5Cddb PROPERTIES DESCRIPTION "KF5 branch for CDDB library" URL "http://projects.kde.org/projects/kde/kdemultimedia/libkcddb" TYPE REQUIRED PURPOSE "libkcddb is used to retrieve audio CD meta data from the internet.") if(K3B_ENABLE_DVD_RIPPING) find_package(DvdRead) set_package_properties(DvdRead PROPERTIES DESCRIPTION "Libdvdread provides a simple foundation for reading DVD video disks." URL "http://www.dtek.chalmers.se/groups/dvd/downloads.shtml" TYPE OPTIONAL) set(ENABLE_DVD_RIPPING "${DVDREAD_FOUND}") endif() if(K3B_ENABLE_TAGLIB) find_package(Taglib) set_package_properties(Taglib PROPERTIES DESCRIPTION "Read and write tags in audio files" URL "http://www.freshmeat.net/projects/taglib" TYPE OPTIONAL) set(ENABLE_TAGLIB "${TAGLIB_FOUND}") endif() if(K3B_ENABLE_MUSICBRAINZ) find_package(MusicBrainz) set_package_properties(MusicBrainz PROPERTIES DESCRIPTION "Provide information about the CD, about the artist or about related information" URL "http://musicbrainz.org" TYPE OPTIONAL) set(ENABLE_MUSICBRAINZ "${MUSICBRAINZ_FOUND}") endif() if(K3B_BUILD_FFMPEG_DECODER_PLUGIN) find_package(FFmpeg) set_package_properties(FFmpeg PROPERTIES PURPOSE "Needed for the K3b FFmpeg decoder plugin which can decode virtually all audio types." URL "http://ffmpeg.org" TYPE OPTIONAL) if(FFMPEG_FOUND) include(CheckSymbolExists) include(CMakePushCheckState) cmake_push_check_state() if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") # FindKDE4Internal.cmake screws things up set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} -std=c99) endif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang") if(FFMPEG_INCLUDE_DIR_OLD_STYLE) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${FFMPEG_INCLUDE_DIR_OLD_STYLE}) set(FFMPEG_HEADERS ffmpeg/avcodec.h ffmpeg/avformat.h) else(FFMPEG_INCLUDE_DIR_OLD_STYLE) set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${FFMPEG_INCLUDE_DIR} ${FFMPEG_INCLUDE_DIRS}) set(FFMPEG_HEADERS libavcodec/avcodec.h libavformat/avformat.h) set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} -DNEWFFMPEGAVCODECPATH) endif(FFMPEG_INCLUDE_DIR_OLD_STYLE) set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${FFMPEG_LIBRARIES}) check_symbol_exists(avformat_open_input "${FFMPEG_HEADERS}" HAVE_FFMPEG_AVFORMAT_OPEN_INPUT) check_symbol_exists(av_dump_format "${FFMPEG_HEADERS}" HAVE_FFMPEG_AV_DUMP_FORMAT) check_symbol_exists(avformat_find_stream_info "${FFMPEG_HEADERS}" HAVE_FFMPEG_AVFORMAT_FIND_STREAM_INFO) check_symbol_exists(avformat_close_input "${FFMPEG_HEADERS}" HAVE_FFMPEG_AVFORMAT_CLOSE_INPUT) check_symbol_exists(avcodec_open2 "${FFMPEG_HEADERS}" HAVE_FFMPEG_AVCODEC_OPEN2) check_symbol_exists(avcodec_decode_audio2 "${FFMPEG_HEADERS}" HAVE_FFMPEG_AVCODEC_DECODE_AUDIO2) check_symbol_exists(avcodec_decode_audio3 "${FFMPEG_HEADERS}" HAVE_FFMPEG_AVCODEC_DECODE_AUDIO3) check_symbol_exists(avcodec_decode_audio4 "${FFMPEG_HEADERS}" HAVE_FFMPEG_AVCODEC_DECODE_AUDIO4) include(CheckCSourceCompiles) check_c_source_compiles(" #ifdef NEWFFMPEGAVCODECPATH #include #else #include #endif int main() { enum AVMediaType t = AVMEDIA_TYPE_UNKNOWN; return 0; } " HAVE_FFMPEG_AVMEDIA_TYPE) check_c_source_compiles(" #ifdef NEWFFMPEGAVCODECPATH #include #else #include #endif int main() { #if LIBAVCODEC_BUILD >= AV_VERSION_INT(54,25,0) # Not needed here. AV_CODEC_ID_MP3 exists. #else enum CodecID t = CODEC_ID_MP3; #endif return 0; } " HAVE_FFMPEG_CODEC_MP3) cmake_pop_check_state() endif(FFMPEG_FOUND) set(BUILD_FFMPEG_DECODER_PLUGIN "${FFMPEG_FOUND}") endif(K3B_BUILD_FFMPEG_DECODER_PLUGIN) if(K3B_BUILD_FLAC_DECODER_PLUGIN) find_package(Flac) set_package_properties(Flac PROPERTIES PURPOSE "Needed for the Flac audio decoder plugin." URL "http://flac.sourceforge.net" TYPE OPTIONAL) find_package(Flac++) set_package_properties(Flac++ PROPERTIES PURPOSE "Needed for the Flac audio decoder plugin." URL "http://flac.sourceforge.net" TYPE OPTIONAL) if(FLAC_FOUND AND FLAC++_FOUND) set(BUILD_FLAC_DECODER_PLUGIN 1) endif() endif() if(K3B_BUILD_MAD_DECODER_PLUGIN) find_package(Mad) set_package_properties(Mad PROPERTIES PURPOSE "Needed for the mp3 audio decoder plugin." URL "http://www.underbit.com/products/mad" TYPE OPTIONAL) set(BUILD_MAD_DECODER_PLUGIN "${MAD_FOUND}") endif() if(K3B_BUILD_MUSE_DECODER_PLUGIN) find_package(Muse) set_package_properties(Muse PROPERTIES PURPOSE "Needed for the Musepack audio decoder plugin" URL "http://www.musepack.net" TYPE OPTIONAL) set(BUILD_MUSE_DECODER_PLUGIN "${MUSE_FOUND}") endif() if(K3B_BUILD_SNDFILE_DECODER_PLUGIN) find_package(Sndfile) set_package_properties(Sndfile PROPERTIES PURPOSE "Needed for the libsndfile audio decoder plugin." URL "http://www.mega-nerd.com/libsndfile" TYPE OPTIONAL) set(BUILD_SNDFILE_DECODER_PLUGIN "${SNDFILE_FOUND}") endif() if(K3B_BUILD_LAME_ENCODER_PLUGIN) find_package(Lame) set_package_properties(Lame PROPERTIES DESCRIPTION "Lame mp3 encoder" PURPOSE "Needed for the lame mpf encoder encoder plugin." URL "http://lame.sourceforge.net" TYPE OPTIONAL) set(BUILD_LAME_ENCODER_PLUGIN "${LAME_FOUND}") endif() if(K3B_BUILD_OGGVORBIS_DECODER_PLUGIN OR K3B_BUILD_OGGVORBIS_ENCODER_PLUGIN) find_package(OggVorbis) set_package_properties(OggVorbis PROPERTIES DESCRIPTION "Ogg Vorbis" PURPOSE "Needed for the K3b Ogg Vorbis decoder and encoder plugins." URL "http://www.vorbis.com" TYPE OPTIONAL) set(BUILD_OGGVORBIS_DECODER_PLUGIN "${OGGVORBIS_FOUND}") set(BUILD_OGGVORBIS_ENCODER_PLUGIN "${OGGVORBIS_FOUND}") endif() ################### K3b build settings ################################# include(ConfigureChecks) set(BUILD_WAVE_DECODER_PLUGIN "${K3B_BUILD_WAVE_DECODER_PLUGIN}") set(BUILD_SOX_ENCODER_PLUGIN "${K3B_BUILD_SOX_ENCODER_PLUGIN}") set(BUILD_EXTERNAL_ENCODER_PLUGIN "${K3B_BUILD_EXTERNAL_ENCODER_PLUGIN}") set(ENABLE_HAL_SUPPORT "${K3B_ENABLE_HAL_SUPPORT}") set(ENABLE_AUDIO_PLAYER "${QT_QTMULTIMEDIA_FOUND}") set(ENABLE_PERMISSION_HELPER "${K3B_ENABLE_PERMISSION_HELPER}") if(IS_ABSOLUTE ${DATA_INSTALL_DIR}) set(K3B_DATA_INSTALL_DIR ${DATA_INSTALL_DIR}/k3b) else() set(K3B_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/k3b) endif() configure_file(config-k3b.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-k3b.h) include_directories(${CMAKE_BINARY_DIR}) ################## K3b apidox ################################ if(K3B_BUILD_API_DOCS) find_package(Doxygen) if(DOXYGEN_EXECUTABLE) configure_file(${CMAKE_SOURCE_DIR}/Doxyfile.cmake ${CMAKE_BINARY_DIR}/Doxyfile) if(EXISTS ${QT_DOC_DIR}/html) set(QTDOCS "${QT_DOC_DIR}/html") else() set(QTDOCS "http://doc.trolltech.com/4.5/") endif() add_custom_target(apidox COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile COMMAND docs/html/installdox -l qt4.tag@${QTDOCS} docs/html/*.html) endif() endif(K3B_BUILD_API_DOCS) ################## K3b build environment ################################ add_subdirectory( libk3bdevice ) add_subdirectory( libk3b ) add_subdirectory( src ) add_subdirectory( kioslaves ) add_subdirectory( plugins ) add_subdirectory( doc ) if(BUILD_TESTING) find_package(Qt5Test REQUIRED) find_package(LibFuzzer) set_package_properties(LibFuzzer PROPERTIES PURPOSE "libFuzzer – a library for coverage-guided fuzz testing." URL "http://libfuzzer.info" TYPE OPTIONAL) - add_subdirectory( tests ) + add_subdirectory(tests) endif() ################### K3b config summary ################################ feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/INSTALL.txt b/INSTALL.txt index dedaaedbe..db9583b6f 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,80 +1,81 @@ Installing K3b 17.11.0 ---------------------- What you need to run K3b: mandatory: - since K3b is a CD writing program a cd writer would be a good thing to have ;-) - the QT5 library (at least version 5.6) - the KDE5 libraries (at least version 5.24.0) - the cdparanoia library for cd ripping from Monty - the cdrtools (cdrecord, mkisofs) from Joerg Schilling - the dvd+rw-tools by Andy Polyakov for DVD writing optional: - cdrdao, the other linux cd writing program from Andreas Mueller - the transcode tools for DVD ripping and DivX/XviD encoding from Thomas Oestreich - vcdimager >= 0.7 for creating video cds - libmad for mp3 decoding - ogg-vorbis libraries for encoding and decoding - the FLAC++ libraries for flac-decoding - the eMovix package - TagLib by Scott Wheeler for reading Meta data tags - the musepack (or now mpcdec) library for decoding Musepack audio files - the ffmpeg library to decode other audio file formats such as wma - the sndfile library to decode audio file formats such as AIFF or VOC - the lame library to encode audio files in the mp3 format - sox to encode audio files in formats such as AIFF or VOC - a dynamically compiled libffmpeg for wma decoding - the musicbrainz library for metadata queries for single audio titles - polkit-qt for K3bSetup (tool for changing permissions of programs and devices) After that it's all the same: mkdir build cd build cmake .. For debug: static analyzer: scan-build -k -v -V cmake .. -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_BUILD_TYPE=Debug \ -DKDE_INSTALL_LIBDIR=lib \ -DKDE_INSTALL_LIBEXECDIR=lib \ -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \ -DK3B_BUILD_API_DOCS=ON \ -DK3B_ENABLE_PERMISSION_HELPER=ON \ -DK3B_DEBUG=ON - dynamic analyzer: + dynamic analyzer and fuzzer: cmake .. -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_CXX_COMPILER=clang++ \ -DECM_ENABLE_SANITIZERS='address;undefined' \ + -DCMAKE_CXX_FLAGS="-fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-bb,trace-cmp" \ -DCMAKE_BUILD_TYPE=Debug \ -DKDE_INSTALL_LIBDIR=lib \ -DKDE_INSTALL_LIBEXECDIR=lib \ -DKDE_INSTALL_USE_QT_SYS_PATHS=ON \ -DK3B_BUILD_API_DOCS=ON \ -DK3B_ENABLE_PERMISSION_HELPER=ON \ -DK3B_DEBUG=ON If the cmake run was successful you are presented with a list of configure results that shows which optional features are enabled. Now just compile K3b: make if for static analyzer: scan-build -k -v -v -v -V make Now you are ready to install: make install (as root) See PERMISSIONS on hints how to properly setup the permissions to use K3b without problems. Have fun Sebastian Trueg (trueg@k3b.org) Leslie Zhai (lesliezhai@llvm.org.cn) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2c9c29879..6538d82db 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,101 +1,100 @@ add_executable(k3bdataprojectmodeltest k3bdataprojectmodeltest.cpp k3btestutils.cpp ${CMAKE_SOURCE_DIR}/src/projects/k3bdataprojectmodel.cpp) target_include_directories(k3bdataprojectmodeltest PRIVATE ${CMAKE_BINARY_DIR}/libk3bdevice ${CMAKE_SOURCE_DIR}/libk3bdevice ${CMAKE_SOURCE_DIR}/src/projects) target_link_libraries(k3bdataprojectmodeltest Qt5::Test KF5::IconThemes KF5::I18n k3blib) add_test(k3bdataprojectmodeltest k3bdataprojectmodeltest) add_executable(k3bglobalstest k3bglobalstest.cpp) target_include_directories(k3bglobalstest PRIVATE ${CMAKE_SOURCE_DIR}/libk3bdevice) target_link_libraries(k3bglobalstest Qt5::Test k3blib) add_test(k3bglobalstest k3bglobalstest) add_executable(k3bmetaitemmodeltest k3bmetaitemmodeltest.cpp ${CMAKE_SOURCE_DIR}/src/k3bmetaitemmodel.cpp) target_include_directories(k3bmetaitemmodeltest PRIVATE ${CMAKE_BINARY_DIR}/libk3b ${CMAKE_SOURCE_DIR}/libk3b/core ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/projects) target_link_libraries( k3bmetaitemmodeltest Qt5::Gui Qt5::Test KF5::ConfigCore) add_test(k3bmetaitemmodeltest k3bmetaitemmodeltest) add_executable(k3bmodelutilstest k3bmodelutilstest.cpp ${CMAKE_SOURCE_DIR}/src/k3bmodelutils.cpp) target_include_directories(k3bmodelutilstest PRIVATE ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/projects) target_link_libraries(k3bmodelutilstest Qt5::Gui Qt5::Test) add_test(k3bmodelutilstest k3bmodelutilstest) add_executable(k3bdeviceglobalstest k3bdeviceglobalstest.cpp) target_include_directories(k3bdeviceglobalstest PRIVATE ${CMAKE_SOURCE_DIR}/libk3bdevice) target_link_libraries(k3bdeviceglobalstest Qt5::Test KF5::KIOCore k3bdevice) add_test(k3bdeviceglobalstest k3bdeviceglobalstest) qt5_generate_dbus_interface(${CMAKE_SOURCE_DIR}/src/k3bjobinterface.h org.k3b.Job.xml) qt5_add_dbus_adaptor(dbus_sources ${CMAKE_CURRENT_BINARY_DIR}/org.k3b.Job.xml ${CMAKE_SOURCE_DIR}/src/k3bjobinterface.h K3b::JobInterface k3bjobinterfaceadaptor K3bJobInterfaceAdaptor) add_executable(k3bexternalbinmanagertest k3bexternalbinmanagertest.cpp stub-k3bapplication.cpp ${CMAKE_SOURCE_DIR}/src/k3bburnprogressdialog.cpp ${CMAKE_SOURCE_DIR}/src/k3bdebuggingoutputdialog.cpp ${CMAKE_SOURCE_DIR}/src/k3bemptydiscwaiter.cpp ${CMAKE_SOURCE_DIR}/src/k3bjobinterface.cpp ${CMAKE_SOURCE_DIR}/src/k3bdebuggingoutputcache.cpp ${CMAKE_SOURCE_DIR}/src/k3bthememanager.cpp ${CMAKE_SOURCE_DIR}/src/k3bthemedlabel.cpp ${CMAKE_SOURCE_DIR}/src/k3bdebuggingoutputfile.cpp ${CMAKE_SOURCE_DIR}/src/k3bjobprogressdialog.cpp ${dbus_sources}) target_include_directories(k3bexternalbinmanagertest PRIVATE ${CMAKE_SOURCE_DIR}/libk3b ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/src/projects ${CMAKE_SOURCE_DIR}/src/projects/kostore ${CMAKE_SOURCE_DIR}/src/helper ${CMAKE_BINARY_DIR}/src) target_link_libraries(k3bexternalbinmanagertest Qt5::Test KF5::I18n KF5::XmlGui KF5::Notifications KF5::IconThemes k3blib k3bdevice) add_test(k3bexternalbinmanagertest k3bexternalbinmanagertest) if(LIBFUZZER_FOUND) + find_package(Threads) add_executable(k3bfuzzertest - k3bfuzzertest.cpp - ${CMAKE_SOURCE_DIR}/libk3b/tools/libisofs/isofs.cpp) - target_include_directories(k3bfuzzertest PRIVATE - ${CMAKE_SOURCE_DIR}/libk3b) + k3bfuzzertest.cpp) target_link_libraries(k3bfuzzertest Qt5::Core - ${LIBFUZZER_LIBRARIES}) + ${LIBFUZZER_LIBRARIES} + ${CMAKE_THREAD_LIBS_INIT}) endif() diff --git a/tests/k3bfuzzertest.cpp b/tests/k3bfuzzertest.cpp index 53edf5684..2a515bc9a 100644 --- a/tests/k3bfuzzertest.cpp +++ b/tests/k3bfuzzertest.cpp @@ -1,20 +1,30 @@ -#include +/* + * Copyright (C) 2016 - 2017 Leslie Zhai + * + * This file is part of the K3b project. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * See the file "COPYING" for the exact licensing terms. + */ -#include "tools/libisofs/isofs.h" +#include +#include +#include extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv) { qDebug() << "DEBUG:" << __PRETTY_FUNCTION__ << *argc; qDebug() << "DEBUG:" << __PRETTY_FUNCTION__ << *argv[0]; return 0; } extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { - char *d = (char *)malloc(1024); - memset(d, 0, 1024); - strncpy(d, "hello", 5); - str_nappend(&d, (char *)Data, Size); - free(d); + // QTBUG-57553 + qDebug() << "DEBUG:" << __PRETTY_FUNCTION__ + << QFile::encodeName(QString::fromRawData((const QChar *)Data, Size)); return 0; }