From 43cd22a6395ca32db09cd8dcc9fa6787dc7a21fa Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 30 Apr 2005 01:15:10 +0000 Subject: [PATCH] Fix ITS#3695 preserve stack alignment in slap_sl_realloc --- servers/slapd/sl_malloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servers/slapd/sl_malloc.c b/servers/slapd/sl_malloc.c index 7931715817..d065c57ec9 100644 --- a/servers/slapd/sl_malloc.c +++ b/servers/slapd/sl_malloc.c @@ -376,6 +376,10 @@ slap_sl_realloc(void *ptr, ber_len_t size, void *ctx) } if (sh->sh_stack) { + /* round up to doubleword boundary */ + size += pad + sizeof( ber_len_t ); + size &= ~pad; + /* Never shrink blocks */ if (size <= p[-1]) { new = p; -- 2.39.5