diff options
author | Ted Gould <ted@gould.cx> | 2012-08-28 15:14:40 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-08-28 15:14:40 -0500 |
commit | 55183a443d93485c8cf9a060b5025cdd10a73d9b (patch) | |
tree | 4fff3e76edacdedbee4e55a63e749734afa18634 /src | |
parent | 66187012c38bfe7c0fd3022b6f0135db575142ca (diff) | |
download | libpam-freerdp2-55183a443d93485c8cf9a060b5025cdd10a73d9b.tar.gz libpam-freerdp2-55183a443d93485c8cf9a060b5025cdd10a73d9b.tar.bz2 libpam-freerdp2-55183a443d93485c8cf9a060b5025cdd10a73d9b.zip |
Making sure that there's no way that we can write over the end of the buffer even for very, very, very long home directory names.
Diffstat (limited to 'src')
-rw-r--r-- | src/pam-freerdp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pam-freerdp.c b/src/pam-freerdp.c index f635162..8129787 100644 --- a/src/pam-freerdp.c +++ b/src/pam-freerdp.c @@ -283,7 +283,7 @@ pam_sm_open_session (pam_handle_t *pamh, int flags, int argc, const char ** argv memset(&socket_addr, 0, sizeof(struct sockaddr_un)); socket_addr.sun_family = AF_UNIX; strncpy(socket_addr.sun_path, pwdent->pw_dir, sizeof(socket_addr.sun_path) - 1); - strncpy(socket_addr.sun_path + strlen(pwdent->pw_dir), "/.freerdp-socket", sizeof(socket_addr.sun_path) - 1); + strncpy(socket_addr.sun_path + strlen(pwdent->pw_dir), "/.freerdp-socket", (sizeof(socket_addr.sun_path) - strlen(pwdent->pw_dir)) - 1); /* We bind the socket before forking so that we ensure that there isn't a race condition to get to it. Things will block |