diff options
author | Tobias Stoeckmann <tobias@stoeckmann.org> | 2024-01-01 21:10:47 +0100 |
---|---|---|
committer | Tobias Stoeckmann <tobias@stoeckmann.org> | 2024-01-02 18:09:28 +0100 |
commit | abfd1bb99edc2e1eee97b1d59e054c8f0b1db759 (patch) | |
tree | 36e62a12cf7f644c940734c13f1fffb896066d7e /modules/pam_env/pam_env.c | |
parent | 889e84082c95f47d7bb128e844c0ceaf3b2896bb (diff) | |
download | pam-abfd1bb99edc2e1eee97b1d59e054c8f0b1db759.tar.gz pam-abfd1bb99edc2e1eee97b1d59e054c8f0b1db759.tar.bz2 pam-abfd1bb99edc2e1eee97b1d59e054c8f0b1db759.zip |
pam_env: fix debug and error messages
The tmpptr variable is only used for resolved variables. If the
creation of expanded string overflows at other places, log the actually
overflowing character instead of a "random" string in tmpptr.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Diffstat (limited to 'modules/pam_env/pam_env.c')
-rw-r--r-- | modules/pam_env/pam_env.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/pam_env/pam_env.c b/modules/pam_env/pam_env.c index 3c4569db..12c7ddd7 100644 --- a/modules/pam_env/pam_env.c +++ b/modules/pam_env/pam_env.c @@ -609,9 +609,9 @@ _expand_arg(pam_handle_t *pamh, char **value) tmp[idx++] = *orig++; /* Note the increment */ } else { /* is it really a good idea to try to log this? */ - D(("Variable buffer overflow: <%s> + <%s>", tmp, tmpptr)); - pam_syslog (pamh, LOG_ERR, "Variable buffer overflow: <%s> + <%s>", - tmp, tmpptr); + D(("Variable buffer overflow: <%s> + <%c>", tmp, *orig)); + pam_syslog (pamh, LOG_ERR, "Variable buffer overflow: <%s> + <%c>", + tmp, *orig); goto buf_err; } continue; @@ -684,9 +684,9 @@ _expand_arg(pam_handle_t *pamh, char **value) tmp[idx++] = *orig++; /* Note the increment */ } else { /* is it really a good idea to try to log this? */ - D(("Variable buffer overflow: <%s> + <%s>", tmp, tmpptr)); + D(("Variable buffer overflow: <%s> + <%c>", tmp, *orig)); pam_syslog(pamh, LOG_ERR, - "Variable buffer overflow: <%s> + <%s>", tmp, tmpptr); + "Variable buffer overflow: <%s> + <%c>", tmp, *orig); goto buf_err; } } |