From b70d375964c55214bd3039c80acfc4f3c0d682f1 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 7 Dec 2004 08:48:28 +0000 Subject: [PATCH] Fix ITS#3420 --- servers/slapd/sl_malloc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/servers/slapd/sl_malloc.c b/servers/slapd/sl_malloc.c index 021f85bb8f..b7a4064430 100644 --- a/servers/slapd/sl_malloc.c +++ b/servers/slapd/sl_malloc.c @@ -376,7 +376,8 @@ slap_sl_realloc(void *ptr, ber_len_t size, void *ctx) new = p; /* If reallocing the last block, we can grow it */ - } else if ((char *)ptr + p[-1] == sh->sh_last) { + } else if ((char *)ptr + p[-1] == sh->sh_last && + (char *)ptr + size < (char *)sh->sh_end ) { new = p; sh->sh_last = (char *)sh->sh_last + size - p[-1]; p[-1] = size; -- 2.39.5