projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move libfuzzer sanitizer options to README
[openssl.git]
/
fuzz
/
driver.c
diff --git
a/fuzz/driver.c
b/fuzz/driver.c
index de515748cefc1137021f02cd7663c4e93c8b62c8..21bbb255afe51066f16af31dff214dee347bba28 100644
(file)
--- a/
fuzz/driver.c
+++ b/
fuzz/driver.c
@@
-9,6
+9,7
@@
*/
#include <stdint.h>
#include <unistd.h>
*/
#include <stdint.h>
#include <unistd.h>
+#include <stdlib.h>
#include <openssl/opensslconf.h>
#include "fuzzer.h"
#include <openssl/opensslconf.h>
#include "fuzzer.h"
@@
-16,12
+17,11
@@
int LLVMFuzzerInitialize(int *argc, char ***argv)
{
int LLVMFuzzerInitialize(int *argc, char ***argv)
{
- if (FuzzerInitialize)
- return FuzzerInitialize(argc, argv);
- return 0;
+ return FuzzerInitialize(argc, argv);
}
}
-int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
+int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
+{
return FuzzerTestOneInput(buf, len);
}
return FuzzerTestOneInput(buf, len);
}
@@
-31,8
+31,7
@@
int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
int main(int argc, char** argv)
{
int main(int argc, char** argv)
{
- if (FuzzerInitialize)
- FuzzerInitialize(&argc, &argv);
+ FuzzerInitialize(&argc, &argv);
while (__AFL_LOOP(10000)) {
uint8_t *buf = malloc(BUF_SIZE);
while (__AFL_LOOP(10000)) {
uint8_t *buf = malloc(BUF_SIZE);
@@
-41,6
+40,8
@@
int main(int argc, char** argv)
FuzzerTestOneInput(buf, size);
free(buf);
}
FuzzerTestOneInput(buf, size);
free(buf);
}
+
+ FuzzerCleanup();
return 0;
}
return 0;
}