1
0
Fork 0
mirror of https://github.com/swaywm/sway.git synced 2025-04-15 18:06:20 +00:00

Merge pull request from espkk/master

Fix clear_password_buffer
This commit is contained in:
Drew DeVault 2018-10-14 14:30:06 +02:00 committed by GitHub
commit dbb169bf15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;