From: Marc Horowitz Date: Sat, 3 Oct 1998 23:54:17 +0000 (+0000) Subject: actually write the trailing nul called for by the comment X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6e82c09c5fe9c48afdf6f101daaa7448ee79677;p=thirdparty%2Fkrb5.git actually write the trailing nul called for by the comment git-svn-id: svn://anonsvn.mit.edu/krb5/branches/marc-3des@10957 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/des/afsstring2key.c b/src/lib/crypto/des/afsstring2key.c index f0364d589a..262f73fced 100644 --- a/src/lib/crypto/des/afsstring2key.c +++ b/src/lib/crypto/des/afsstring2key.c @@ -28,7 +28,7 @@ mit_afs_string_to_key (keyblock, data, salt) register krb5_octet *key = keyblock->contents; if (data->length <= 8) { - char password[9]; /* trailing null for crypt() */ + char password[9]; /* trailing nul for crypt() */ strncpy(password, realm, 8); for (i=0; i<8; i++) if (isupper(password[i])) @@ -38,6 +38,7 @@ mit_afs_string_to_key (keyblock, data, salt) for (i=0; i<8; i++) if (password[i] == '\0') password[i] = 'X'; + password[8] = '\0'; strncpy(key, (char *) afs_crypt(password, "#~") + 2, 8); for (i=0; i<8; i++) key[i] <<= 1;