silence deepstate output, print libFuzzer output without warning

This commit is contained in:
Alex Groce 2018-07-27 22:13:21 -07:00
parent d95dcf65e3
commit 9fa8c4bcf7
3 changed files with 17 additions and 3 deletions

View File

@ -23,6 +23,8 @@
DEEPSTATE_BEGIN_EXTERN_C
extern int DeepState_UsingLibFuzzer;
struct DeepState_Stream;
struct DeepState_VarArgs {

View File

@ -549,8 +549,8 @@ extern int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
return 0; // Just ignore any too-big inputs
}
printf("LLVM fuzzing with input of size %ul\n", Size);
DeepState_UsingLibFuzzer = 1;
struct DeepState_TestInfo *test = NULL;
DeepState_InitOptions(0, "");

View File

@ -64,6 +64,8 @@ enum {
DeepState_LogBufSize = 4096
};
int DeepState_UsingLibFuzzer = 0;
char DeepState_LogBuf[DeepState_LogBufSize + 1] = {};
/* Log a C string. */
@ -144,7 +146,17 @@ int __vprintf_chk(int flag, const char *format, va_list args) {
DEEPSTATE_NOINLINE
int vfprintf(FILE *file, const char *format, va_list args) {
if (stderr == file) {
if (DeepState_UsingLibFuzzer) {
if (stderr == file) {
// Silence DeepState output
// DeepState_LogVFormat(DeepState_LogDebug, format, args);
} else if (stdout == file) {
// Silence DeepState output
// DeepState_LogVFormat(DeepState_LogInfo, format, args);
} else {
DeepState_LogVFormat(DeepState_LogInfo, format, args);
}
} else if (stderr == file) {
DeepState_LogVFormat(DeepState_LogDebug, format, args);
} else if (stdout == file) {
DeepState_LogVFormat(DeepState_LogInfo, format, args);