diff options
author | 2021-05-15 19:16:47 +0100 | |
---|---|---|
committer | 2021-05-15 19:16:47 +0100 | |
commit | 3895320c7f0ebdcc12b62bb9efd0276bdc089de5 (patch) | |
tree | f4761dad796f5d2b2a9d69f16b9499b37394c283 /projects/znc | |
parent | 364100101432107b41fd62576fa55c7b82f57f1e (diff) |
[znc] Initial integration (#5748)
Diffstat (limited to 'projects/znc')
-rw-r--r-- | projects/znc/Dockerfile | 21 | ||||
-rwxr-xr-x | projects/znc/build.sh | 33 | ||||
-rw-r--r-- | projects/znc/msg_parse_fuzzer.cpp | 30 | ||||
-rw-r--r-- | projects/znc/project.yaml | 10 |
4 files changed, 94 insertions, 0 deletions
diff --git a/projects/znc/Dockerfile b/projects/znc/Dockerfile new file mode 100644 index 00000000..923e0155 --- /dev/null +++ b/projects/znc/Dockerfile @@ -0,0 +1,21 @@ +# Copyright 2021 Google LLC +# +# 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. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder +RUN apt-get update && apt-get install -y make +RUN git clone --depth 1 https://github.com/znc/znc +WORKDIR $SRC/znc +COPY build.sh msg_parse_fuzzer.cpp $SRC/ diff --git a/projects/znc/build.sh b/projects/znc/build.sh new file mode 100755 index 00000000..7472ad8b --- /dev/null +++ b/projects/znc/build.sh @@ -0,0 +1,33 @@ +#!/bin/bash -eu +# Copyright 2021 Google LLC +# +# 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. +# +################################################################################ + +git submodule update --init --recursive +mkdir build && cd build +cmake -DBUILD_SHARED_LIBS=OFF \ + -DWANT_ICU=OFF \ + -DWANT_OPENSSL=OFF \ + -DWANT_ZLIB=OFF \ + -DWANT_IPV6=OFF .. +make -j$(nproc) + +$CXX $CXXFLAGS -DGTEST_HAS_POSIX_RE=0 \ + -I/src/znc/include -I/src/znc/build/include \ + -fPIE -include znc/zncconfig.h -std=c++11 \ + -c $SRC/msg_parse_fuzzer.cpp -o msg_parse_fuzzer.o +$CXX $CXXFLAGS $LIB_FUZZING_ENGINE \ + msg_parse_fuzzer.o -o $OUT/msg_parse_fuzzer \ + /src/znc/build/src/libznc.a diff --git a/projects/znc/msg_parse_fuzzer.cpp b/projects/znc/msg_parse_fuzzer.cpp new file mode 100644 index 00000000..73389459 --- /dev/null +++ b/projects/znc/msg_parse_fuzzer.cpp @@ -0,0 +1,30 @@ +/* +# Copyright 2021 Google LLC +# +# 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 <stdint.h> +#include <znc/Message.h> + +extern "C" +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){ + std::string input(reinterpret_cast<const char*>(data), size); + CMessage msg; + msg.Parse(input); + msg.SetParam(1, input); + msg.GetParams(); + return 0; +} diff --git a/projects/znc/project.yaml b/projects/znc/project.yaml new file mode 100644 index 00000000..b9dd8bc3 --- /dev/null +++ b/projects/znc/project.yaml @@ -0,0 +1,10 @@ +homepage: "https://znc.in" +language: c++ +primary_contact: "alexey+znc@asokolov.org" +auto_ccs: + - "Adam@adalogics.com" +sanitizers: + - address + - undefined + - memory +main_repo: "https://github.com/znc/znc" |