Skip to content

Commit

Permalink
oss-fuzz: Minimum size for config test
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Mar 3, 2024
1 parent 0705101 commit 73bd5ae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fuzzing/broker/broker_fuzz_test_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#include <sys/stat.h>
#include <unistd.h>

#include "broker_fuzz.h"

/*
* Broker check of config only, the config isn't used
*/
Expand Down Expand Up @@ -55,6 +57,10 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
char filename[100];
FILE *fptr;

if(size < kMinInputLength){
return 0;
}

umask(0077);

snprintf(filename, sizeof(filename), "/tmp/mosquitto_%d.conf", getpid());
Expand Down

0 comments on commit 73bd5ae

Please sign in to comment.