(encrypt_v4_ticket): error check malloc properly

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6391 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-07-03 02:24:27 +00:00
parent 7c193baf6f
commit 6e2c225c70

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan * Copyright (c) 1997 - 1999 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -454,7 +454,7 @@ encrypt_v4_ticket(void *buf, size_t len, des_cblock *key, EncryptedData *reply)
reply->kvno = NULL; reply->kvno = NULL;
reply->cipher.length = len; reply->cipher.length = len;
reply->cipher.data = malloc(len); reply->cipher.data = malloc(len);
if(reply->cipher.data == NULL) if(len != 0 && reply->cipher.data == NULL)
return ENOMEM; return ENOMEM;
des_set_key(key, schedule); des_set_key(key, schedule);
des_pcbc_encrypt(buf, des_pcbc_encrypt(buf,