From: Greg Hudson Date: Sun, 13 May 2012 19:42:50 +0000 (-0400) Subject: Check alloc_data result in krb5int_old_encrypt X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cfd3d8dbd6c0f3270427bc3172f84a0562a06593;p=krb5.git Check alloc_data result in krb5int_old_encrypt --- diff --git a/src/lib/crypto/krb/enc_old.c b/src/lib/crypto/krb/enc_old.c index f33cacb5c..e7160b169 100644 --- a/src/lib/crypto/krb/enc_old.c +++ b/src/lib/crypto/krb/enc_old.c @@ -104,6 +104,8 @@ krb5int_old_encrypt(const struct krb5_keytypes *ktp, krb5_key key, /* Use the key as the ivec for des-cbc-crc if none was provided. */ if (key->keyblock.enctype == ENCTYPE_DES_CBC_CRC && ivec == NULL) { ret = alloc_data(&crcivec, key->keyblock.length); + if (ret != 0) + goto cleanup; memcpy(crcivec.data, key->keyblock.contents, key->keyblock.length); ivec = &crcivec; }