diff options
author | David Tardon <dtardon@redhat.com> | 2018-10-09 15:04:58 +0200 |
---|---|---|
committer | Sven Eden <sven.eden@prydeworx.com> | 2018-10-29 10:18:32 +0100 |
commit | bc83abc6cfe8bd4d5974afbf442fca1e45c25d37 (patch) | |
tree | 2c60c9c1e91c916cb17e4222157af8766032785d /src/login/pam_elogind.c | |
parent | f6cd6aca48f487513db9ded2fdd177df7214b340 (diff) |
be consistent about sun_path length
Most places use the whole buffer for name, without leaving extra space
for the trailing NUL.
(cherry picked from commit f369f47c264dd56f630e91697006efd647542feb)
Diffstat (limited to 'src/login/pam_elogind.c')
-rw-r--r-- | src/login/pam_elogind.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/login/pam_elogind.c b/src/login/pam_elogind.c index 1d634baa9..63cbbbc1d 100644 --- a/src/login/pam_elogind.c +++ b/src/login/pam_elogind.c @@ -130,7 +130,7 @@ static int get_seat_from_display(const char *display, const char **seat, uint32_ r = socket_from_display(display, &p); if (r < 0) return r; - strncpy(sa.un.sun_path, p, sizeof(sa.un.sun_path)-1); + strncpy(sa.un.sun_path, p, sizeof(sa.un.sun_path)); fd = socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0); if (fd < 0) |