diff options
author | Tobias Stoeckmann <tobias@stoeckmann.org> | 2023-12-15 11:52:33 +0100 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2023-12-19 12:22:59 +0000 |
commit | 45d3d6b5021a6b5e49bc2923cd422ef3fecf1640 (patch) | |
tree | e4522a2cb9de6fe556b60f18addf99d65783e695 /modules | |
parent | 2e375aad04d047e12468f93300ad7e42a8a03ff3 (diff) | |
download | pam-45d3d6b5021a6b5e49bc2923cd422ef3fecf1640.tar.gz pam-45d3d6b5021a6b5e49bc2923cd422ef3fecf1640.tar.bz2 pam-45d3d6b5021a6b5e49bc2923cd422ef3fecf1640.zip |
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 <tobias@stoeckmann.org>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/pam_access/pam_access.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, "."); |