aboutsummaryrefslogtreecommitdiff
path: root/lib/libpam/modules/pam_exec/pam_exec.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpam/modules/pam_exec/pam_exec.c')
-rw-r--r--lib/libpam/modules/pam_exec/pam_exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libpam/modules/pam_exec/pam_exec.c b/lib/libpam/modules/pam_exec/pam_exec.c
index 2b0e92914348..dc4a47e22c08 100644
--- a/lib/libpam/modules/pam_exec/pam_exec.c
+++ b/lib/libpam/modules/pam_exec/pam_exec.c
@@ -254,7 +254,8 @@ _pam_exec(pam_handle_t *pamh,
}
rc = pam_get_authtok(pamh, PAM_AUTHTOK, &authtok, NULL);
if (rc == PAM_SUCCESS) {
- authtok_size = strlen(authtok);
+ /* We include the trailing NUL-terminator. */
+ authtok_size = strlen(authtok) + 1;
} else {
openpam_log(PAM_LOG_ERROR, "%s: pam_get_authtok(): %s", func,
pam_strerror(pamh, rc));