aboutsummaryrefslogtreecommitdiffstats
path: root/src/fuzzer/uri.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/fuzzer/uri.cpp')
-rw-r--r--src/fuzzer/uri.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/fuzzer/uri.cpp b/src/fuzzer/uri.cpp
new file mode 100644
index 000000000..89066d283
--- /dev/null
+++ b/src/fuzzer/uri.cpp
@@ -0,0 +1,20 @@
+/*
+* (C) 2019 Nuno Goncalves <[email protected]>
+*
+* Botan is released under the Simplified BSD License (see license.txt)
+*/
+
+#include "fuzzers.h"
+#include <botan/internal/uri.h>
+
+void fuzz(const uint8_t in[], size_t len)
+ {
+ if(len > max_fuzzer_input_size)
+ return;
+
+ try
+ {
+ Botan::URI::fromAny(std::string(reinterpret_cast<const char*>(in), len));
+ }
+ catch(Botan::Exception& e) { }
+ }