From: Richard Levitte Date: Tue, 3 Dec 2002 16:06:40 +0000 (+0000) Subject: Make CRYPTO_cleanse() independent of endianness. X-Git-Tag: STATE_before_zlib~33 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=470799152037586dd51e9ec7d39304ddca873b22;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;