From 77b37ccc22049fd6e0e365754d7617684ce7759b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Wed, 11 Oct 2006 14:29:13 +0000 Subject: [PATCH] better error/special situation handling in recv_token() - prevent some rare-but-hard-to-catch errors --- org.glite.security.gsoap-plugin/src/glite_gss.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/org.glite.security.gsoap-plugin/src/glite_gss.c b/org.glite.security.gsoap-plugin/src/glite_gss.c index e13a63d..eda6021 100644 --- a/org.glite.security.gsoap-plugin/src/glite_gss.c +++ b/org.glite.security.gsoap-plugin/src/glite_gss.c @@ -366,8 +366,12 @@ recv_token(int sock, void **token, size_t *token_length, struct timeval *to) goto end; } } - if (count == 0 && tl == 0 && errno == 0) - return EDG_WLL_GSS_ERROR_EOF; + + if (count==0) { + if (tl==0) + return EDG_WLL_GSS_ERROR_EOF; + else goto end; + } tmp=realloc(t, tl + count); if (tmp == NULL) { errno = ENOMEM; @@ -832,6 +836,7 @@ edg_wll_gss_read(edg_wll_GssConnection *connection, void *buf, size_t bufsize, /* XXX cleanup */ return ret; + maj_stat = gss_unwrap(&min_stat, connection->context, &input_token, &output_token, NULL, NULL); gss_release_buffer(&min_stat, &input_token); -- 1.8.2.3