Skip to content

Commit

Permalink
Do not define fuzz function if fuzzing is not enabled.
Browse files Browse the repository at this point in the history
Resolves unused function warnings.
  • Loading branch information
jvalenzuela authored and MartinMelikMerkumians committed Jul 10, 2023
1 parent 5375e60 commit 4c9345b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/src/ports/POSIX/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ static void *executeEventLoop(void *pthread_arg);
/** @brief Fuzz TCP packets handling flow with AFL.
*
*/
#ifdef FUZZING_AFL
static void fuzzHandlePacketFlow(void);
#endif /* FUZZING_AFL */

/*****************************************************************************/
/** @brief Flag indicating if the stack should end its execution
Expand Down Expand Up @@ -265,8 +267,8 @@ static void *executeEventLoop(void *pthread_arg) {
return &pthread_dummy_ret;
}

static void fuzzHandlePacketFlow(void) {
#ifdef FUZZING_AFL
static void fuzzHandlePacketFlow(void) {
int socket_fd = 0; // Fake socket fd
uint8_t buff[512]; // Input buffer
struct sockaddr_in from_address = { 0 }; // Fake socket address
Expand All @@ -293,5 +295,5 @@ static void fuzzHandlePacketFlow(void) {
&from_address,
&outgoing_message);
}
#endif
}
#endif /* FUZZING_AFL */

0 comments on commit 4c9345b

Please sign in to comment.