Skip to content

Commit 327f815

Browse files
authored
libhtp: fuzz only the C version (#13422)
As the rust version is now part of Suricata repo Should fix build failure https://issues.oss-fuzz.com/issues/422433464
1 parent e78c2e2 commit 327f815

File tree

4 files changed

+1
-42
lines changed

4 files changed

+1
-42
lines changed

projects/libhtp/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,5 @@
1717
FROM gcr.io/oss-fuzz-base/base-builder-rust
1818
RUN apt-get update && apt-get install -y make autoconf automake libtool zlib1g-dev liblzma-dev
1919
RUN git clone --depth 1 https://github.com/OISF/libhtp.git libhtp
20-
RUN git clone --branch main --depth 1 https://github.com/catenacyber/libhtp-rs.git libhtp-rs
2120
WORKDIR $SRC
2221
COPY build.sh $SRC/
23-
COPY multiple.txt $SRC/

projects/libhtp/build.sh

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,6 @@
1616
################################################################################
1717

1818
# build project
19-
(
20-
cd libhtp-rs
21-
export CARGO_BUILD_TARGET="x86_64-unknown-linux-gnu"
22-
cargo fuzz build -O
23-
cargo fuzz list | while read i; do
24-
# debug for coverage build
25-
cp fuzz/target/x86_64-unknown-linux-gnu/release/$i $OUT/ || cp fuzz/target/x86_64-unknown-linux-gnu/debug/$i $OUT/
26-
done
27-
if [ "$SANITIZER" = "address" ]
28-
then
29-
export RUSTFLAGS="$RUSTFLAGS -Cpasses=sancov-module -Cllvm-args=-sanitizer-coverage-level=4 -Cllvm-args=-sanitizer-coverage-trace-compares -Cllvm-args=-sanitizer-coverage-inline-8bit-counters -Cllvm-args=-sanitizer-coverage-trace-geps -Cllvm-args=-sanitizer-coverage-prune-blocks=0 -Cllvm-args=-sanitizer-coverage-pc-table -Clink-dead-code -Cllvm-args=-sanitizer-coverage-stack-depth"
30-
fi
31-
cat $SRC/multiple.txt | while read i; do
32-
git grep $i | cut -d: -f1 | uniq | xargs sed -i -e s/$i/"$i"_rs/;
33-
done
34-
# build in release mode to avoid timeouts
35-
cargo build -r
36-
cp ./target/x86_64-unknown-linux-gnu/release/libhtp.a ../libhtp-rs.a
37-
)
38-
3919
cd libhtp
4020
sh autogen.sh
4121
./configure
@@ -45,9 +25,5 @@ $CC $CFLAGS -I. -c test/fuzz/fuzz_htp.c -o fuzz_htp.o
4525
$CC $CFLAGS -I. -c test/test.c -o test.o
4626
$CXX $CXXFLAGS fuzz_htp.o test.o -o $OUT/fuzz_htp_c ./htp/.libs/libhtp.a $LIB_FUZZING_ENGINE -lz -llzma
4727

48-
$CC $CFLAGS -I. -c test/fuzz/fuzz_diff.c -o fuzz_diff.o
49-
$CXX $CXXFLAGS fuzz_diff.o test.o -o $OUT/fuzz_diff ./htp/.libs/libhtp.a ../libhtp-rs.a $LIB_FUZZING_ENGINE -lz -llzma
50-
5128
# builds corpus
5229
zip -r $OUT/fuzz_htp_seed_corpus.zip test/files/*.t
53-
zip -r $OUT/fuzz_diff_seed_corpus.zip test/files/*.t

projects/libhtp/multiple.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

projects/libhtp/project.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
homepage: "https://github.com/OISF/libhtp"
2-
language: rust
2+
language: c
33
primary_contact: "vjulien@openinfosecfoundation.org"
44
auto_ccs :
55
- "p.antoine@catenacyber.fr"
66
- "jish@openinfosecfoundation.org"
7-
- "todd.mortimer@gmail.com"
87

98
sanitizers:
109
- address

0 commit comments

Comments
 (0)