From 3a32125abb5fc019ec13c1bfe21238666f688368 Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Fri, 7 May 2021 19:30:10 +0100 Subject: [PATCH] oatpp: cleanup project. (#5735) Fuzzer has been merged upstream --- projects/oatpp/Dockerfile | 1 - projects/oatpp/build.sh | 3 ++- projects/oatpp/fuzz_mapper.cpp | 40 ---------------------------------- 3 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 projects/oatpp/fuzz_mapper.cpp diff --git a/projects/oatpp/Dockerfile b/projects/oatpp/Dockerfile index daeab9cc4..43ef579ca 100644 --- a/projects/oatpp/Dockerfile +++ b/projects/oatpp/Dockerfile @@ -19,4 +19,3 @@ RUN apt-get update && apt-get install -y make autoconf automake libtool RUN git clone --depth 1 https://github.com/oatpp/oatpp.git oatpp WORKDIR oatpp COPY build.sh $SRC/ -COPY fuzz_mapper.cpp $SRC/ diff --git a/projects/oatpp/build.sh b/projects/oatpp/build.sh index 18e55d052..8fc23cd6e 100755 --- a/projects/oatpp/build.sh +++ b/projects/oatpp/build.sh @@ -18,5 +18,6 @@ mkdir build && cd build cmake ../ make -$CXX $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/fuzz_mapper.cpp -o $OUT/fuzz_mapper \ + +$CXX $CXXFLAGS $LIB_FUZZING_ENGINE ../fuzzers/oatpp/parser/json/mapping/ObjectMapper.cpp -o $OUT/fuzz_mapper \ ./src/liboatpp.a -I../src diff --git a/projects/oatpp/fuzz_mapper.cpp b/projects/oatpp/fuzz_mapper.cpp deleted file mode 100644 index c26e727d3..000000000 --- a/projects/oatpp/fuzz_mapper.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright 2020 Google Inc. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -#include "oatpp/parser/json/mapping/ObjectMapper.hpp" -#include "oatpp/core/macro/codegen.hpp" - -typedef oatpp::parser::Caret ParsingCaret; -typedef oatpp::parser::json::mapping::Serializer Serializer; -typedef oatpp::parser::json::mapping::Deserializer Deserializer; - -#include OATPP_CODEGEN_BEGIN(DTO) - -class EmptyDto : public oatpp::DTO { - DTO_INIT(EmptyDto, DTO) -}; - - -class Test1 : public oatpp::DTO { - DTO_INIT(Test1, DTO) - DTO_FIELD(String, strF); -}; - -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { - oatpp::String input(reinterpret_cast(data), size, true); - oatpp::parser::json::mapping::ObjectMapper mapper; - try { - mapper.readFromString>(input); - } catch(...) {} - - return 0; -}