Skip to content

Commit

Permalink
remove leak-fix, make fuzzer-compile-logic for pipeline better
Browse files Browse the repository at this point in the history
  • Loading branch information
linderd authored and tobhe committed Sep 4, 2023
1 parent 54a669d commit 14699d8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .clusterfuzzlite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM gcr.io/oss-fuzz-base/base-builder:v1

ENV CLUSTERFUZZLITE=TRUE
RUN apt-get update && apt-get install -y bison libssl-dev libevent-dev libsystemd-dev
COPY . $SRC/openiked-portable
WORKDIR openiked-portable
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ endif()
if(CLUSTERFUZZ)
message("Compiling parser-libfuzzer")
add_subdirectory(regress/parser-libfuzzer)
if (NOT DEFINED ENV{CC} OR NOT DEFINED ENV{CFLAGS})
if (NOT DEFINED ENV{CLUSTERFUZZLITE})
set(CMAKE_C_COMPILER clang)
string(APPEND CMAKE_C_FLAGS " -g -O1 -fsanitize=fuzzer-no-link")
endif()
Expand Down
2 changes: 1 addition & 1 deletion iked/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ endif()
target_include_directories(iked PRIVATE ${INC_DIRS})
target_include_directories(iked-shared PRIVATE ${INC_DIRS})

if(CLUSTERFUZZ AND DEFINED ENV{CC} AND DEFINED ENV{CFLAGS})
if(DEFINED ENV{CLUSTERFUZZLITE})
target_link_libraries(iked-shared
"-lm -Wl,-Bstatic -lssl -lcrypto -levent -Wl,-Bdynamic" compat
)
Expand Down
3 changes: 0 additions & 3 deletions iked/ikev2_pld.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,9 +853,6 @@ ikev2_pld_cert(struct iked *env, struct ikev2_payload *pld,
}
}

if (certid->id_buf) {
ibuf_free(certid->id_buf);
}
if ((certid->id_buf = ibuf_new(buf, len)) == NULL) {
log_debug("%s: failed to save cert", __func__);
return (-1);
Expand Down
2 changes: 1 addition & 1 deletion regress/parser-libfuzzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ target_include_directories(test_libfuzzer
)

# when using clusterfuzz we need static linking and clusterfuzz' compiler arguments
if (DEFINED ENV{CC} AND DEFINED ENV{CFLAGS})
if (DEFINED ENV{CLUSTERFUZZLITE})
target_link_libraries(test_libfuzzer
"-lm -Wl,-Bstatic -lssl -lcrypto -levent" compat iked-shared $ENV{LIB_FUZZING_ENGINE}
)
Expand Down

0 comments on commit 14699d8

Please sign in to comment.