From d8f811b9246b4806512c7f436c698e84ae59edfa Mon Sep 17 00:00:00 2001 From: cantor Date: Fri, 5 Mar 2010 03:49:03 +0000 Subject: [PATCH] Check for empty parameters during construction. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/branches/REL_2@3238 cb58f699-b61c-0410-a6fe-9272a202ed29 --- shibsp/handler/impl/TransformSessionInitiator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shibsp/handler/impl/TransformSessionInitiator.cpp b/shibsp/handler/impl/TransformSessionInitiator.cpp index ac53b42..590dbad 100644 --- a/shibsp/handler/impl/TransformSessionInitiator.cpp +++ b/shibsp/handler/impl/TransformSessionInitiator.cpp @@ -98,12 +98,14 @@ namespace shibsp { flag = &chNull; if (XMLString::equals(e->getLocalName(), Subst)) { auto_ptr_char temp(e->getFirstChild()->getNodeValue()); - m_subst.push_back(pair((*flag==chDigit_1 || *flag==chLatin_t), temp.get())); + if (temp.get() && *temp.get()) + m_subst.push_back(pair((*flag==chDigit_1 || *flag==chLatin_t), temp.get())); } else if (XMLString::equals(e->getLocalName(), Regex) && e->hasAttributeNS(NULL, match)) { auto_ptr_char m(e->getAttributeNS(NULL, match)); auto_ptr_char repl(e->getFirstChild()->getNodeValue()); - m_regex.push_back(make_pair((*flag==chDigit_1 || *flag==chLatin_t), pair(m.get(), repl.get()))); + if (m.get() && *m.get() && repl.get() && *repl.get()) + m_regex.push_back(make_pair((*flag==chDigit_1 || *flag==chLatin_t), pair(m.get(), repl.get()))); } else { m_log.warn("Unknown element found in Transform SessionInitiator configuration, check for errors."); -- 2.1.4