From: Howard Chu Date: Tue, 7 Dec 2004 08:48:28 +0000 (+0000) Subject: Fix ITS#3420 X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~108 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b70d375964c55214bd3039c80acfc4f3c0d682f1;p=openldap Fix ITS#3420 --- 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;