Created
April 13, 2023 12:26
-
-
Save personnumber3377/9dd028ec9e1d6408845d220d9955baf5 to your computer and use it in GitHub Desktop.
Fuzzing patch for curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/tool_main.c b/src/tool_main.c | |
index 2274bd0f4..701c178af 100644 | |
--- a/src/tool_main.c | |
+++ b/src/tool_main.c | |
@@ -50,7 +50,7 @@ | |
#include "tool_vms.h" | |
#include "tool_main.h" | |
#include "tool_libinfo.h" | |
- | |
+#include "../../AFLplusplus/utils/argv_fuzzing/argv-fuzz-inl.h" | |
/* | |
* This is low-level hard-hacking memory leak tracking and similar. Using | |
* the library level code from this client-side is ugly, but we do this | |
@@ -240,7 +240,7 @@ int main(int argc, char *argv[]) | |
CURLcode result = CURLE_OK; | |
struct GlobalConfig global; | |
memset(&global, 0, sizeof(global)); | |
- | |
+ AFL_INIT_ARGV(); | |
#ifdef WIN32 | |
/* Undocumented diagnostic option to list the full paths of all loaded | |
modules. This is purposely pre-init. */ | |
@@ -292,7 +292,9 @@ int main(int argc, char *argv[]) | |
#ifdef __VMS | |
vms_special_exit(result, vms_show); | |
#else | |
- return (int)result; | |
+ // MODIFIED: This must always return 0 because otherwise we get a false positive crash. | |
+ return 0; | |
+ //return (int)result; | |
#endif | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment