aboutsummaryrefslogtreecommitdiffstats
path: root/src/fuzzer
diff options
context:
space:
mode:
authorNuno Goncalves <[email protected]>2019-03-03 21:45:01 +0100
committerNuno Goncalves <[email protected]>2019-10-14 15:59:38 +0200
commit5a02e9c100ca49c580ac50bfb88d101d88553972 (patch)
treec7638364a0fe57bbf59ef32de24a3aca313c2f2c /src/fuzzer
parenteed3adbba406221fbb6c5d932b48c813c41429f8 (diff)
Add URI class to parse IPv4, IPv6 and domain names together with port number
Signed-off-by: Nuno Goncalves <[email protected]>
Diffstat (limited to 'src/fuzzer')
-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) { }
+ }