summaryrefslogtreecommitdiff
path: root/dll.cpp
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2003-08-04 19:00:41 +0000
committerweidai <weidai11@users.noreply.github.com>2003-08-04 19:00:41 +0000
commit89862d12200bebff8ba59dcbc19eafdb266d6a0d (patch)
treefb58ae8f9f7914a6a69f7becead49588338698bd /dll.cpp
parent5c3dbb91a256f810d30e0c8940bf3e90aa70a4a2 (diff)
downloadcryptopp-git-89862d12200bebff8ba59dcbc19eafdb266d6a0d.tar.gz
guard against potential integer overflow in allocators
Diffstat (limited to 'dll.cpp')
-rw-r--r--dll.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/dll.cpp b/dll.cpp
index a51a897e..9efaec78 100644
--- a/dll.cpp
+++ b/dll.cpp
@@ -56,18 +56,9 @@ static PDelete s_pDelete = NULL;
static void * CRYPTOPP_CDECL New (size_t size)
{
- new_handler newHandler = set_new_handler(NULL);
- if (newHandler)
- set_new_handler(newHandler);
-
void *p;
while (!(p = malloc(size)))
- {
- if (newHandler)
- newHandler();
- else
- throw std::bad_alloc();
- }
+ CallNewHandler();
return p;
}