Ver Fonte

clean stack properly

Steffen Jaeckel há 8 anos atrás
pai
commit
2858373e2e
1 ficheiros alterados com 2 adições e 2 exclusões
  1. 2 2
      src/hashes/chc/chc.c

+ 2 - 2
src/hashes/chc/chc.c

@@ -147,11 +147,11 @@ static int chc_compress(hash_state *md, unsigned char *buf)
    for (x = 0; x < cipher_blocksize; x++) {
        md->chc.state[x] ^= T[0][x] ^ T[1][x];
    }
-   XFREE(key);
 #ifdef LTC_CLEAN_STACK
    zeromem(T, sizeof(T));
-   zeromem(&key, sizeof(key));
+   zeromem(key, sizeof(*key));
 #endif
+   XFREE(key);
    return CRYPT_OK;
 }