From cd11d66f33ed140018af7b6419aa1571ceaa873b Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Mon, 13 Nov 2023 14:00:17 +0100 Subject: pam_env: force format string to be constant As the string to output here is user-controlled this could lead to format string attacks. Possible impact is at least information leakage about the program stack. To avoid this, make the format string fixed and insert the actual string for output as an argument. Signed-off-by: Benny Baumann --- modules/pam_env/pam_env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/pam_env') diff --git a/modules/pam_env/pam_env.c b/modules/pam_env/pam_env.c index d675ae37..a5c47d92 100644 --- a/modules/pam_env/pam_env.c +++ b/modules/pam_env/pam_env.c @@ -464,7 +464,7 @@ _parse_line(const pam_handle_t *pamh, const char *buffer, VAR *var) ptr = buffer+length; while ((length = strspn(ptr, " \t")) > 0) { ptr += length; /* remove leading whitespace */ - D((ptr)); + D(("%s", ptr)); if ((tmpptr = pam_str_skip_prefix(ptr, "DEFAULT=")) != NULL) { ptr = tmpptr; D(("Default arg found: <%s>", ptr)); -- cgit v1.2.3