From: Jeffrey Altman Date: Wed, 16 May 2007 04:33:38 +0000 (+0000) Subject: windows-aklog-20070515 X-Git-Tag: BP-openafs-windows-kdfs-ifs~703 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=60bbb56b546438d5e89854f61bcea368c5537341;p=packages%2Fo%2Fopenafs.git windows-aklog-20070515 FIXES 60938 do not copy an uninitialized field --- diff --git a/src/WINNT/aklog/aklog.c b/src/WINNT/aklog/aklog.c index 0dd6156a4..25a62b044 100644 --- a/src/WINNT/aklog/aklog.c +++ b/src/WINNT/aklog/aklog.c @@ -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]) )