aboutsummaryrefslogtreecommitdiff
path: root/libpam
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2024-01-05 18:34:56 +0100
committerDmitry V. Levin <ldv@strace.io>2024-01-05 23:36:44 +0000
commitfdf6cc1a1ade2c6c46c494d99ce890306571de65 (patch)
tree9e974798ef2f3456533581d5377ecc39f3ddb8ea /libpam
parent9291f8b78f192bdd254ed751369760be61e6d2d8 (diff)
downloadpam-fdf6cc1a1ade2c6c46c494d99ce890306571de65.tar.gz
pam-fdf6cc1a1ade2c6c46c494d99ce890306571de65.tar.bz2
pam-fdf6cc1a1ade2c6c46c494d99ce890306571de65.zip
libpam: clear config line memory before free
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Diffstat (limited to 'libpam')
-rw-r--r--libpam/include/pam_assemble_line.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpam/include/pam_assemble_line.h b/libpam/include/pam_assemble_line.h
index e2d4d89f..651776e9 100644
--- a/libpam/include/pam_assemble_line.h
+++ b/libpam/include/pam_assemble_line.h
@@ -71,7 +71,9 @@ static inline int _pam_buffer_add_eol(struct line_buffer *buffer,
static void _pam_buffer_clear(struct line_buffer *buffer)
{
+ pam_overwrite_n(buffer->assembled, buffer->size);
_pam_drop(buffer->assembled);
+ pam_overwrite_n(buffer->chunk, buffer->chunk_size);
_pam_drop(buffer->chunk);
buffer->chunk_size = 0;
buffer->len = 0;
@@ -87,6 +89,7 @@ static void _pam_buffer_init(struct line_buffer *buffer)
static void _pam_buffer_purge(struct line_buffer *buffer)
{
+ pam_overwrite_n(buffer->chunk, buffer->chunk_size);
_pam_drop(buffer->chunk);
buffer->chunk_size = 0;
}