check provider enabled before non-marshalled initializing
authorLuke Howard <lukeh@padl.com>
Sun, 27 Mar 2011 01:52:43 +0000 (12:52 +1100)
committerLuke Howard <lukeh@padl.com>
Sun, 27 Mar 2011 01:52:43 +0000 (12:52 +1100)
util_attr.cpp

index 2b4d7c4..ed45cd3 100644 (file)
@@ -344,7 +344,7 @@ gss_eap_attr_ctx::initFromBuffer(const gss_buffer_t buffer)
     for (type = ATTR_TYPE_MIN; type <= ATTR_TYPE_MAX; type++) {
         gss_eap_attr_provider *provider;
 
-        if (didInit[type])
+        if (didInit[type] || !providerEnabled(type))
             continue;
 
         provider = m_providers[type];
@@ -354,11 +354,11 @@ gss_eap_attr_ctx::initFromBuffer(const gss_buffer_t buffer)
                                            GSS_C_NO_CONTEXT);
         if (ret == false) {
             releaseProvider(type);
-            break;
+            return false;
         }
     }
 
-    return ret;
+    return true;
 }
 
 gss_eap_attr_ctx::~gss_eap_attr_ctx(void)