s3: Ensure null termination in winbindd_pam_chauthtok()
authorVolker Lendecke <vl@samba.org>
Wed, 31 Mar 2010 20:05:02 +0000 (22:05 +0200)
committerVolker Lendecke <vl@samba.org>
Wed, 31 Mar 2010 20:07:38 +0000 (22:07 +0200)
source3/winbindd/winbindd_pam.c

index 74b82370bfd3c5dfcf001a4e49b55745712375d6..aa804c801fefa7e05f9c67bc45bc2d4b16df5297 100644 (file)
@@ -2014,6 +2014,10 @@ void winbindd_pam_chauthtok(struct winbindd_cli_state *state)
        struct winbindd_domain *contact_domain;
        NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
 
+       /* Ensure null termination */
+       state->request->data.chauthtok.user[
+               sizeof(state->request->data.chauthtok.user)-1]='\0';
+
        DEBUG(3, ("[%5lu]: pam chauthtok %s\n", (unsigned long)state->pid,
                state->request->data.chauthtok.user));