From d50f0d7caa79acd400e550b2ca9476d5810ba280 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 24 May 2014 04:58:15 +0200 Subject: add volatile to ptr in passphrase_wipe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/passphrase.c | 2 +- src/passphrase.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/passphrase.c b/src/passphrase.c index 9fb4ef5..7f65c72 100644 --- a/src/passphrase.c +++ b/src/passphrase.c @@ -373,7 +373,7 @@ volatile sig_atomic_t passphrase_wipe_volatile = 1; * @param ptr The password to wipe * @param n The number of characters to wipe */ -void passphrase_wipe(char* ptr, size_t n) +void passphrase_wipe(volatile char* ptr, size_t n) { size_t i; for (i = 0; (i < n) && passphrase_wipe_volatile; i++) diff --git a/src/passphrase.h b/src/passphrase.h index 0731404..10c9914 100644 --- a/src/passphrase.h +++ b/src/passphrase.h @@ -33,7 +33,7 @@ extern char* passphrase_read(void); * @param ptr The password to wipe * @param n The number of characters to wipe */ -extern void passphrase_wipe(char* ptr, size_t n) __attribute__((optimize("-O0"))); +extern void passphrase_wipe(volatile char* ptr, size_t n) __attribute__((optimize("-O0"))); /** * Disable echoing and do anything else to the terminal settnings `passphrase_read` requires -- cgit v1.2.3-70-g09d2