summaryrefslogtreecommitdiff
path: root/dll.cpp
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-08-04 19:00:41 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-08-04 19:00:41 +0000
commitb7de36416b07d49df3bedbab2fc249db0972a438 (patch)
treefb58ae8f9f7914a6a69f7becead49588338698bd /dll.cpp
parentaac7f66e943347feaa4e9d501644d10cb5bd6d5f (diff)
downloadcryptopp-b7de36416b07d49df3bedbab2fc249db0972a438.tar.gz
guard against potential integer overflow in allocators
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@128 57ff6487-cd31-0410-9ec3-f628ee90f5f0
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 a51a897..9efaec7 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;
}