s3: Ensure NULL termination before printing in winbindd_pam_logoff
authorVolker Lendecke <vl@samba.org>
Thu, 1 Apr 2010 14:32:44 +0000 (16:32 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 1 Apr 2010 14:34:01 +0000 (16:34 +0200)
source3/winbindd/winbindd_pam.c

index d660102655fa67d9f2d47efc2080b991c0a40618..d4dc5e58b919f47beaf31e7fdbc9d71fb29e0443 100644 (file)
@@ -2224,9 +2224,6 @@ void winbindd_pam_logoff(struct winbindd_cli_state *state)
        uid_t caller_uid = (uid_t)-1;
        uid_t request_uid = state->request->data.logoff.uid;
 
-       DEBUG(3, ("[%5lu]: pam logoff %s\n", (unsigned long)state->pid,
-               state->request->data.logoff.user));
-
        /* Ensure null termination */
        state->request->data.logoff.user
                [sizeof(state->request->data.logoff.user)-1]='\0';
@@ -2234,6 +2231,9 @@ void winbindd_pam_logoff(struct winbindd_cli_state *state)
        state->request->data.logoff.krb5ccname
                [sizeof(state->request->data.logoff.krb5ccname)-1]='\0';
 
+       DEBUG(3, ("[%5lu]: pam logoff %s\n", (unsigned long)state->pid,
+               state->request->data.logoff.user));
+
        if (request_uid == (uid_t)-1) {
                goto failed;
        }