[cpp-sp] 04/09: SSPCPP-711 Bracket a regexp with a try/catch
Scott Cantor
cantor.2 at osu.edu
Mon Nov 13 11:46:28 EST 2017
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch maint-2.6
in repository cpp-sp.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=9656aad2428e11f95aee2e451cb6876086d6cba3
commit 9656aad2428e11f95aee2e451cb6876086d6cba3
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed Mar 1 09:00:59 2017 +0000
SSPCPP-711 Bracket a regexp with a try/catch
https://issues.shibboleth.net/jira/browse/SSPCPP-711
---
.../filtering/impl/AttributeMatchesShibMDScopeFunctor.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/shibsp/attribute/filtering/impl/AttributeMatchesShibMDScopeFunctor.cpp b/shibsp/attribute/filtering/impl/AttributeMatchesShibMDScopeFunctor.cpp
index 2d64126..ff4da4e 100644
--- a/shibsp/attribute/filtering/impl/AttributeMatchesShibMDScopeFunctor.cpp
+++ b/shibsp/attribute/filtering/impl/AttributeMatchesShibMDScopeFunctor.cpp
@@ -96,8 +96,14 @@ namespace shibsp {
const XMLCh* val = rule.getValue();
if (val && *val) {
if (rule.Regexp()) {
- RegularExpression re(val);
- return re.matches(scope.get());
+ try {
+ RegularExpression re(val);
+ return re.matches(scope.get());
+ }
+ catch (XMLException& ex) {
+ xmltooling::auto_ptr_char temp(ex.getMessage());
+ throw ConfigurationException(temp.get());
+ }
}
else {
return XMLString::equals(val, scope.get());
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list