From: Richard Levitte Date: Tue, 3 Dec 2002 16:07:03 +0000 (+0000) Subject: Make CRYPTO_cleanse() independent of endianness. X-Git-Tag: OpenSSL_0_9_7-beta5~22 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=49cd4b7316879bf8655be2d3927e840e7fcaf546;p=oweals%2Fopenssl.git Make CRYPTO_cleanse() independent of endianness. --- diff --git a/crypto/mem_clr.c b/crypto/mem_clr.c index 0b72966cfa..e4b7f540b0 100644 --- a/crypto/mem_clr.c +++ b/crypto/mem_clr.c @@ -68,7 +68,7 @@ void OPENSSL_cleanse(void *ptr, size_t len) while(loop--) { *(p++) = cleanse_ctr; - cleanse_ctr += (17 + (((unsigned char *)&p)[sizeof(unsigned char *)-1] & 0xF)); + cleanse_ctr += (17 + (unsigned char)((int)p & 0xF)); } if(memchr(ptr, cleanse_ctr, len)) cleanse_ctr += 63;