From 42f72f8bb4a8d835f1c535108602dccb329160c6 Mon Sep 17 00:00:00 2001 From: espkk Date: Sun, 14 Oct 2018 07:40:33 +0300 Subject: [PATCH] swaylock: fix clear_password_buffer --- swaylock/password.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swaylock/password.c b/swaylock/password.c index 6a956bcbc..50b81f6bf 100644 --- a/swaylock/password.c +++ b/swaylock/password.c @@ -14,7 +14,7 @@ void clear_password_buffer(struct swaylock_password *pw) { // Use volatile keyword so so compiler can't optimize this out. volatile char *buffer = pw->buffer; volatile char zero = '\0'; - for (size_t i = 0; i < sizeof(buffer); ++i) { + for (size_t i = 0; i < sizeof(pw->buffer); ++i) { buffer[i] = zero; } pw->len = 0;