mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
2547. [bug] openssl_link.c:mem_realloc() could reference an
out-of-range area of the source buffer. New public function isc_mem_reallocate() was introduced to address this bug. [RT #19313]
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
|
||||
/*
|
||||
* Principal Author: Brian Wellington
|
||||
* $Id: openssl_link.c,v 1.24 2009/01/17 23:47:42 tbox Exp $
|
||||
* $Id: openssl_link.c,v 1.25 2009/02/11 03:04:18 jinmei Exp $
|
||||
*/
|
||||
#ifdef OPENSSL
|
||||
|
||||
@@ -148,18 +148,8 @@ mem_free(void *ptr) {
|
||||
|
||||
static void *
|
||||
mem_realloc(void *ptr, size_t size) {
|
||||
void *p;
|
||||
|
||||
INSIST(dst__memory_pool != NULL);
|
||||
p = NULL;
|
||||
if (size > 0U) {
|
||||
p = mem_alloc(size);
|
||||
if (p != NULL && ptr != NULL)
|
||||
memcpy(p, ptr, size);
|
||||
}
|
||||
if (ptr != NULL)
|
||||
mem_free(ptr);
|
||||
return (p);
|
||||
return (isc_mem_reallocate(dst__memory_pool, ptr, size));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
|
Reference in New Issue
Block a user