Make CRYPTO_cleanse() independent of endianness.
authorRichard Levitte <levitte@openssl.org>
Tue, 3 Dec 2002 16:06:40 +0000 (16:06 +0000)
committerRichard Levitte <levitte@openssl.org>
Tue, 3 Dec 2002 16:06:40 +0000 (16:06 +0000)
crypto/mem_clr.c

index 0b72966..e4b7f54 100644 (file)
@@ -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;