]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#3695 preserve stack alignment in slap_sl_realloc
authorHoward Chu <hyc@openldap.org>
Sat, 30 Apr 2005 01:15:10 +0000 (01:15 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 30 Apr 2005 01:15:10 +0000 (01:15 +0000)
servers/slapd/sl_malloc.c

index 79317158174d4e5ccdccc9c6049ad9d514564376..d065c57ec9166a3cb99da6699810de0eb4136513 100644 (file)
@@ -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;