aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Sergey Nizovtsev <snizovtsev@gmail.com>2020-11-09 17:55:00 +0300
committerGravatar GitHub <noreply@github.com>2020-11-09 06:55:00 -0800
commita0528670aace2fade32ab5b40cefa133ff70a4b7 (patch)
treedb995ce38061aaaa2ccee547846a74ef4bc13a25
parent24f263f32df4cbb307f1ceb764c0c3c97fdd3f9e (diff)
[tmux] Initial integration (#4593)
Signed-off-by: Sergey Nizovtsev
-rw-r--r--projects/tmux/Dockerfile24
-rw-r--r--projects/tmux/build.sh46
-rw-r--r--projects/tmux/project.yaml8
3 files changed, 78 insertions, 0 deletions
diff --git a/projects/tmux/Dockerfile b/projects/tmux/Dockerfile
new file mode 100644
index 00000000..ed3e14ed
--- /dev/null
+++ b/projects/tmux/Dockerfile
@@ -0,0 +1,24 @@
+# Copyright 2020 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 autoconf automake bison pkg-config \
+ libevent-dev ncurses-dev
+
+RUN git clone --depth 1 https://github.com/snizovtsev/tmux.git
+RUN git clone --depth 1 https://github.com/snizovtsev/tmux-fuzzing-corpus.git
+WORKDIR tmux
+COPY build.sh $SRC/
diff --git a/projects/tmux/build.sh b/projects/tmux/build.sh
new file mode 100644
index 00000000..53de126a
--- /dev/null
+++ b/projects/tmux/build.sh
@@ -0,0 +1,46 @@
+#!/bin/bash -eu
+# Copyright 2020 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.
+#
+################################################################################
+
+./autogen.sh
+./configure \
+ --enable-fuzzing \
+ FUZZING_LIBS="${LIB_FUZZING_ENGINE} -lc++" \
+ LIBEVENT_LIBS="-Wl,-Bstatic -levent -Wl,-Bdynamic" \
+ LIBTINFO_LIBS="-Wl,-Bstatic -ltinfo -Wl,-Bdynamic"
+
+make -j"$(nproc)" check
+find "${SRC}/tmux/fuzz/" -name '*-fuzzer' -exec cp -v '{}' "${OUT}"/ \;
+find "${SRC}/tmux/fuzz/" -name '*-fuzzer.options' -exec cp -v '{}' "${OUT}"/ \;
+find "${SRC}/tmux/fuzz/" -name '*-fuzzer.dict' -exec cp -v '{}' "${OUT}"/ \;
+
+MAXLEN=$(grep -Po 'max_len\s+=\s+\K\d+' "${OUT}/input-fuzzer.options")
+mkdir "${WORK}/fuzzing_corpus"
+cd "${WORK}/fuzzing_corpus"
+bash "${SRC}/tmux/tools/24-bit-color.sh" | \
+ split -a4 -db$MAXLEN - 24-bit-color.out.
+perl "${SRC}/tmux/tools/256colors.pl" | \
+ split -a4 -db$MAXLEN - 256colors.out.
+cat "${SRC}/tmux/tools/UTF-8-demo.txt" | \
+ split -a4 -db$MAXLEN - UTF-8-demo.txt.
+cat "${SRC}/tmux-fuzzing-corpus/alacritty"/* | \
+ split -a4 -db$MAXLEN - alacritty.
+cat "${SRC}/tmux-fuzzing-corpus/esctest"/* | \
+ split -a4 -db$MAXLEN - esctest.
+cat "${SRC}/tmux-fuzzing-corpus/iterm2"/* | \
+ split -a5 -db$MAXLEN - iterm2.
+zip -q -j -r "${OUT}/input-fuzzer_seed_corpus.zip" \
+ "${WORK}/fuzzing_corpus/"
diff --git a/projects/tmux/project.yaml b/projects/tmux/project.yaml
new file mode 100644
index 00000000..c7d1933c
--- /dev/null
+++ b/projects/tmux/project.yaml
@@ -0,0 +1,8 @@
+homepage: "https://tmux.github.io/"
+language: c
+primary_contact: nicholas.marriott@gmail.com
+auto_ccs:
+ - security@openbsd.org
+sanitizers:
+ - address
+ - undefined