check return copy_Realm, copy_PrincipalName, copy_EncryptionKey

The ASN.1 functions copy_Realm(), copy_PrincipalName() and
copy_EncryptionKey() can fail.  Check the return and perform error
handling as appropriate.

Change-Id: I2b3629d19db96eb41d1cd554cef1dca99745e753
This commit is contained in:
Jeffrey Altman
2017-04-29 15:22:23 -04:00
parent cb1ab5b5fc
commit 6f3ab01c75
6 changed files with 53 additions and 17 deletions

View File

@@ -271,7 +271,11 @@ krb5_rd_cred(krb5_context context,
}
if(creds->ticket.length != len)
krb5_abortx(context, "internal error in ASN.1 encoder");
copy_EncryptionKey (&kci->key, &creds->session);
ret = copy_EncryptionKey (&kci->key, &creds->session);
if (ret) {
krb5_free_creds(context, creds);
goto out;
}
if (kci->prealm && kci->pname)
_krb5_principalname2krb5_principal (context,
&creds->client,