git.samba.org
/
abartlet
/
samba.git
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
502f47c
)
Prevent reallocs of the talloc pool itself
author
Simo Sorce
<ssorce@redhat.com>
Tue, 21 Apr 2009 07:08:37 +0000
(
03:08
-0400)
committer
Simo Sorce
<ssorce@redhat.com>
Wed, 22 Apr 2009 13:58:06 +0000
(09:58 -0400)
lib/talloc/talloc.c
patch
|
blob
|
history
diff --git
a/lib/talloc/talloc.c
b/lib/talloc/talloc.c
index 60a48ad8112593754fe1729f2dc3e243924fc76d..33cbfd7d268dc737e95948c44575ac6c53d835d7 100644
(file)
--- a/
lib/talloc/talloc.c
+++ b/
lib/talloc/talloc.c
@@
-1008,6
+1008,11
@@
void *_talloc_realloc(const void *context, void *ptr, size_t size, const char *n
return NULL;
}
+ /* don't let anybody try to realloc a talloc_pool */
+ if (unlikely(tc->flags & TALLOC_FLAG_POOL)) {
+ return NULL;
+ }
+
/* don't shrink if we have less than 1k to gain */
if ((size < tc->size) && ((tc->size - size) < 1024)) {
tc->size = size;