From: Howard Chu Date: Sat, 30 Apr 2005 01:15:10 +0000 (+0000) Subject: Fix ITS#3695 preserve stack alignment in slap_sl_realloc X-Git-Tag: OPENLDAP_AC_BP~761 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=43cd22a6395ca32db09cd8dcc9fa6787dc7a21fa;p=openldap Fix ITS#3695 preserve stack alignment in slap_sl_realloc --- 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;