From 45d3d6b5021a6b5e49bc2923cd422ef3fecf1640 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Fri, 15 Dec 2023 11:52:33 +0100 Subject: pam_access: reserve space for dot character It should not happen that inet_ntop uses all space available, but let's better be safe than sorry, since strcat won't check for us. Signed-off-by: Tobias Stoeckmann --- modules/pam_access/pam_access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/pam_access') diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c index e3ec441d..8bdc8eae 100644 --- a/modules/pam_access/pam_access.c +++ b/modules/pam_access/pam_access.c @@ -759,7 +759,7 @@ remote_match (pam_handle_t *pamh, char *tok, struct login_info *item) DIAG_PUSH_IGNORE_CAST_ALIGN; inet_ntop (runp->ai_family, &((struct sockaddr_in *) runp->ai_addr)->sin_addr, - buf, sizeof (buf)); + buf, sizeof (buf) - 1); DIAG_POP_IGNORE_CAST_ALIGN; strcat (buf, "."); -- cgit v1.2.3