summaryrefslogtreecommitdiff
path: root/kcm
diff options
context:
space:
mode:
authorLove Hörnquist Åstrand <lha@kth.se>2008-11-02 07:15:45 +0000
committerLove Hörnquist Åstrand <lha@kth.se>2008-11-02 07:15:45 +0000
commitca4645d2636a557e06a9d6594dbc808cc0b792f4 (patch)
tree4b8f796e67479707cab71bd7b583fdbf8de6a276 /kcm
parentc6f509df8d6fed09aefe7eeed766cf35c7b13709 (diff)
handle return value of krb5_storage_{read,write}
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@24011 ec53bebd-3082-4978-b11e-865c3cabbd6b
Diffstat (limited to 'kcm')
-rw-r--r--kcm/protocol.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/kcm/protocol.c b/kcm/protocol.c
index 0d6d2625c..db3d0d211 100644
--- a/kcm/protocol.c
+++ b/kcm/protocol.c
@@ -440,9 +440,12 @@ kcm_op_get_first(krb5_context context,
return ret;
for (creds = ccache->creds ; creds ; creds = creds->next) {
- ret = krb5_storage_write(response, &creds->uuid, sizeof(creds->uuid));
- if (ret)
+ ssize_t sret;
+ sret = krb5_storage_write(response, &creds->uuid, sizeof(creds->uuid));
+ if (sret != sizeof(creds->uuid)) {
+ ret = ENOMEM;
break;
+ }
}
kcm_release_ccache(context, &ccache);
@@ -470,6 +473,7 @@ kcm_op_get_next(krb5_context context,
char *name;
struct kcm_creds *c;
uuid_t uuid;
+ ssize_t sret;
ret = krb5_ret_stringz(request, &name);
if (ret)
@@ -483,9 +487,12 @@ kcm_op_get_next(krb5_context context,
if (ret)
return ret;
- ret = krb5_storage_read(request, &uuid, sizeof(uuid));
- if (ret)
- return ret;
+ sret = krb5_storage_read(request, &uuid, sizeof(uuid));
+ if (sret != sizeof(uuid)) {
+ kcm_release_ccache(context, &ccache);
+ krb5_clear_error_message(context);
+ return KRB5_CC_IO;
+ }
c = kcm_ccache_find_cred_uuid(context, ccache, uuid);
if (c == NULL) {