diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-04-21 03:08:37 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-04-22 09:58:06 -0400 |
commit | b029e0edcf356772c66190af843087f14c88b3f2 (patch) | |
tree | 32d6eeb1ce6dbeb04f698503bdd8815d6091c836 | |
parent | 502f47c7c07b8075fb28a8591acd1e43f7708f54 (diff) | |
download | samba-b029e0edcf356772c66190af843087f14c88b3f2.tar.gz samba-b029e0edcf356772c66190af843087f14c88b3f2.tar.bz2 samba-b029e0edcf356772c66190af843087f14c88b3f2.zip |
Prevent reallocs of the talloc pool itself
-rw-r--r-- | lib/talloc/talloc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c index 60a48ad811..33cbfd7d26 100644 --- 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; |