(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:
@@ -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,
|
||||||
|
Reference in New Issue
Block a user