mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
(secmem_realloc): Take control information into account
when testing for a resize.
This commit is contained in:
parent
37f8183d05
commit
b79b1b9399
@ -1,3 +1,8 @@
|
|||||||
|
2005-03-10 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
|
* secmem.c (secmem_realloc): Take control information into account
|
||||||
|
when testing for a resize.
|
||||||
|
|
||||||
2004-12-03 David Shaw <dshaw@jabberwocky.com>
|
2004-12-03 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* http.c (send_request): Include the port if non-80 in the Host:
|
* http.c (send_request): Include the port if non-80 in the Host:
|
||||||
|
@ -393,6 +393,10 @@ secmem_realloc( void *p, size_t newsize )
|
|||||||
|
|
||||||
mb = (MEMBLOCK*)((char*)p - ((size_t) &((MEMBLOCK*)0)->u.aligned.c));
|
mb = (MEMBLOCK*)((char*)p - ((size_t) &((MEMBLOCK*)0)->u.aligned.c));
|
||||||
size = mb->size;
|
size = mb->size;
|
||||||
|
if (size < sizeof(MEMBLOCK))
|
||||||
|
log_bug ("secure memory corrupted at block %p\n", mb);
|
||||||
|
size -= ((size_t) &((MEMBLOCK*)0)->u.aligned.c);
|
||||||
|
|
||||||
if( newsize < size )
|
if( newsize < size )
|
||||||
return p; /* it is easier not to shrink the memory */
|
return p; /* it is easier not to shrink the memory */
|
||||||
a = secmem_malloc( newsize );
|
a = secmem_malloc( newsize );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user