]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
actually write the trailing nul called for by the comment
authorMarc Horowitz <marc@mit.edu>
Sat, 3 Oct 1998 23:54:17 +0000 (23:54 +0000)
committerMarc Horowitz <marc@mit.edu>
Sat, 3 Oct 1998 23:54:17 +0000 (23:54 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/branches/marc-3des@10957 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/des/afsstring2key.c

index f0364d589aa5eba0faec0cd8fb7d259249a3ee4c..262f73fcedc91dfcc2e5abb0918bbe88d280c148 100644 (file)
@@ -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;