silence deepstate output, print libFuzzer output without warning
This commit is contained in:
parent
d95dcf65e3
commit
9fa8c4bcf7
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
DEEPSTATE_BEGIN_EXTERN_C
|
DEEPSTATE_BEGIN_EXTERN_C
|
||||||
|
|
||||||
|
extern int DeepState_UsingLibFuzzer;
|
||||||
|
|
||||||
struct DeepState_Stream;
|
struct DeepState_Stream;
|
||||||
|
|
||||||
struct DeepState_VarArgs {
|
struct DeepState_VarArgs {
|
||||||
|
|||||||
@ -549,7 +549,7 @@ extern int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|||||||
return 0; // Just ignore any too-big inputs
|
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;
|
struct DeepState_TestInfo *test = NULL;
|
||||||
|
|
||||||
|
|||||||
@ -64,6 +64,8 @@ enum {
|
|||||||
DeepState_LogBufSize = 4096
|
DeepState_LogBufSize = 4096
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int DeepState_UsingLibFuzzer = 0;
|
||||||
|
|
||||||
char DeepState_LogBuf[DeepState_LogBufSize + 1] = {};
|
char DeepState_LogBuf[DeepState_LogBufSize + 1] = {};
|
||||||
|
|
||||||
/* Log a C string. */
|
/* Log a C string. */
|
||||||
@ -144,7 +146,17 @@ int __vprintf_chk(int flag, const char *format, va_list args) {
|
|||||||
|
|
||||||
DEEPSTATE_NOINLINE
|
DEEPSTATE_NOINLINE
|
||||||
int vfprintf(FILE *file, const char *format, va_list args) {
|
int vfprintf(FILE *file, const char *format, va_list args) {
|
||||||
|
if (DeepState_UsingLibFuzzer) {
|
||||||
if (stderr == file) {
|
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);
|
DeepState_LogVFormat(DeepState_LogDebug, format, args);
|
||||||
} else if (stdout == file) {
|
} else if (stdout == file) {
|
||||||
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
DeepState_LogVFormat(DeepState_LogInfo, format, args);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user