summaryrefslogtreecommitdiff
path: root/comm.c
diff options
context:
space:
mode:
authorRobin Ebert <ebertrobin2002@gmail.com>2022-05-30 11:50:30 +0200
committerSimon Ser <contact@emersion.fr>2022-06-15 10:49:32 +0200
commitbdeb891378bfcb2dc79de41cfeb6a62807d09b20 (patch)
treea9eef0cdb2d2fba56404291ab25a0ce48402b79b /comm.c
parentfad5bc2f615bcee37b653887af0aebb334ec94b5 (diff)
Use mlock for password buffer
Diffstat (limited to 'comm.c')
-rw-r--r--comm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/comm.c b/comm.c
index 7855a7f..6add38a 100644
--- a/comm.c
+++ b/comm.c
@@ -5,6 +5,7 @@
#include "comm.h"
#include "log.h"
#include "swaylock.h"
+#include "password-buffer.h"
static int comm[2][2] = {{-1, -1}, {-1, -1}};
@@ -19,9 +20,8 @@ ssize_t read_comm_request(char **buf_ptr) {
return -1;
}
swaylock_log(LOG_DEBUG, "received pw check request");
- char *buf = malloc(size);
+ char *buf = password_buffer_create(size);
if (!buf) {
- swaylock_log_errno(LOG_ERROR, "failed to malloc pw buffer");
return -1;
}
size_t offs = 0;