aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-11-07 09:15:06 -0500
committerJack Lloyd <[email protected]>2018-11-07 09:15:06 -0500
commit4e2f0e5d741e8b4471870e4e01817e152dd2be50 (patch)
tree5cd290b64859dfeaecda9c78c81ae9011c51ccb4 /src
parentd7f0634af763484bca5ce1992d1c187a7e003e03 (diff)
Avoid throwing std:: exceptions
Also include <new> in mem_ops.cpp as apparently that header is where bad_alloc is defined.
Diffstat (limited to 'src')
-rw-r--r--src/cli/tls_http_server.cpp2
-rw-r--r--src/lib/utils/mem_ops.cpp1
-rw-r--r--src/tests/test_tests.cpp2
3 files changed, 3 insertions, 2 deletions
diff --git a/src/cli/tls_http_server.cpp b/src/cli/tls_http_server.cpp
index 053f9e055..6b5cefab4 100644
--- a/src/cli/tls_http_server.cpp
+++ b/src/cli/tls_http_server.cpp
@@ -127,7 +127,7 @@ class HTTP_Parser
headers[hdr_name] = hdr_val;
if(headers.size() > 1024)
- throw std::runtime_error("That's an awful lot of headers");
+ throw Botan::Invalid_Argument("Too many HTTP headers sent in request");
}
if(verb != "" && location != "")
diff --git a/src/lib/utils/mem_ops.cpp b/src/lib/utils/mem_ops.cpp
index b7ecd5326..668437e9f 100644
--- a/src/lib/utils/mem_ops.cpp
+++ b/src/lib/utils/mem_ops.cpp
@@ -6,6 +6,7 @@
#include <botan/mem_ops.h>
#include <cstdlib>
+#include <new>
#if defined(BOTAN_HAS_LOCKING_ALLOCATOR)
#include <botan/locking_allocator.h>
diff --git a/src/tests/test_tests.cpp b/src/tests/test_tests.cpp
index 3a52b85b9..eb5b1d42e 100644
--- a/src/tests/test_tests.cpp
+++ b/src/tests/test_tests.cpp
@@ -143,7 +143,7 @@ class Test_Tests final : public Test
{
Test::Result test_result(testcase_name);
test_result.test_throws("test_throws", "expected msg",
- []() { throw std::runtime_error("not the message"); });
+ []() { throw Botan::Exception("not the message"); });
verify_failure("test_throws", result, test_result);
}