Use correct length to malloc() in encrypt_key_data()
authorPaul Park <pjpark@mit.edu>
Tue, 8 Aug 1995 21:58:45 +0000 (21:58 +0000)
committerPaul Park <pjpark@mit.edu>
Tue, 8 Aug 1995 21:58:45 +0000 (21:58 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6459 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kdb/encrypt_key.c

index cc8cf0be86b6a4450aeea01faca6cf3b21f6dbbf..d22d73d22e4968e08b87d0a4b26a54c9b9f37c4a 100644 (file)
@@ -73,7 +73,7 @@ krb5_dbekd_encrypt_key_data(context, eblock, keyblock, keysalt, keyver,key_data)
 
     memcpy((char *)tmp.contents, (const char *)keyblock->contents, tmp.length);
     key_data->key_data_contents[0] = ptr = (krb5_octet *)malloc(
-                                       key_data->key_data_length[0] - 2);
+                                       key_data->key_data_length[0]);
     if (key_data->key_data_contents[0] == NULL) {
        krb5_xfree(tmp.contents);
        return ENOMEM;