(krb5_ret_data): check for length == 0

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2237 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-07-13 01:13:37 +00:00
parent 7f80781f31
commit 3b138d4040

View File

@@ -137,10 +137,13 @@ krb5_ret_data(krb5_storage *sp,
if(ret)
return ret;
data->length = size;
if (size) {
data->data = malloc(size);
ret = sp->fetch(sp, data->data, size);
if(ret != size)
return (ret < 0)? errno : KRB5_CC_END;
} else
data->data = NULL;
return 0;
}