cleanup
authorLuke Howard <lukeh@padl.com>
Thu, 21 Oct 2010 13:39:27 +0000 (00:39 +1100)
committerLuke Howard <lukeh@padl.com>
Thu, 21 Oct 2010 13:39:27 +0000 (00:39 +1100)
util_saml.cpp

index 41ef77e..ab06f39 100644 (file)
@@ -161,17 +161,21 @@ gss_eap_saml_assertion_provider::parseAssertion(const gss_buffer_t buffer)
     DOMDocument *doc;
     const XMLObjectBuilder *b;
 
-    doc = XMLToolingConfig::getConfig().getParser().parse(istream);
-    if (doc == NULL)
-        return NULL;
+    try {
+        doc = XMLToolingConfig::getConfig().getParser().parse(istream);
+        if (doc == NULL)
+            return NULL;
 
-    b = XMLObjectBuilder::getBuilder(doc->getDocumentElement());
+        b = XMLObjectBuilder::getBuilder(doc->getDocumentElement());
 
 #ifdef __APPLE__
-    return (saml2::Assertion *)((void *)b->buildFromDocument(doc));
+        return (saml2::Assertion *)((void *)b->buildFromDocument(doc));
 #else
-    return dynamic_cast<saml2::Assertion *>(b->buildFromDocument(doc));
+        return dynamic_cast<saml2::Assertion *>(b->buildFromDocument(doc));
 #endif
+    } catch (exception &e) {
+        return NULL;
+    }
 }
 
 bool