]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
windows-aklog-20070515
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 16 May 2007 04:33:38 +0000 (04:33 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 16 May 2007 04:33:38 +0000 (04:33 +0000)
FIXES 60938

do not copy an uninitialized field

src/WINNT/aklog/aklog.c

index 0dd6156a4c89041da9f68f76c57433ee3f248c8c..25a62b044d01bd6d4a97c4f1efadc27dba3e8959 100644 (file)
@@ -255,8 +255,10 @@ void ViceIDToUsername(char *username, char *realm_of_user, char *realm_of_cell,
             }
             id = 0;
             strncpy(aclient->name, username, MAXKTCNAMELEN - 1);
+            aclient->name[MAXKTCNAMELEN - 1] = '\0';
             strcpy(aclient->instance, "");
-            strncpy(aclient->cell, c->realm, MAXKTCREALMLEN - 1);
+            strncpy(aclient->cell, cell_to_use, MAXKTCREALMLEN - 1);
+            aclient->cell[MAXKTCREALMLEN - 1] = '\0';
 
             for ( i=0; aclient->cell[i]; i++ ) {
                 if ( islower(aclient->cell[i]) )