strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7707357
)
leak_detective: Assign return value of realloc to buf
author
Thomas Egerer
<thomas.egerer@secunet.com>
Mon, 10 Feb 2014 16:14:24 +0000
(17:14 +0100)
committer
Martin Willi
<martin@revosec.ch>
Mon, 10 Feb 2014 16:23:54 +0000
(17:23 +0100)
If realloc return a pointer value different from the value to be
reallocated, a double free can occur in this context.
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
src/libstrongswan/utils/leak_detective.c
patch
|
blob
|
history
diff --git
a/src/libstrongswan/utils/leak_detective.c
b/src/libstrongswan/utils/leak_detective.c
index
36ed173
..
ff80bbc
100644
(file)
--- a/
src/libstrongswan/utils/leak_detective.c
+++ b/
src/libstrongswan/utils/leak_detective.c
@@
-483,7
+483,7
@@
static void* real_realloc(void *ptr, size_t size)
static bool register_hooks()
{
void *buf = real_malloc(8);
- real_realloc(buf, 16);
+
buf =
real_realloc(buf, 16);
real_free(buf);
return TRUE;
}