summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2015-04-04 08:45:02 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2015-04-07 13:03:49 (GMT)
commitd8f39d6867deb230350c8d082ee0584717a71e3c (patch)
tree9e9733898b33ea1a286e722593bcc73a0b7a0c0f
parent4b4c63e97e57949ee9f1bc0a7e6f08aad6d903ff (diff)
downloadmodmellon-upstream.zip
modmellon-upstream.tar.gz
modmellon-upstream.tar.bz2
Fix handling of attribute valuesupstream
AttributeValue->any can contain any number of MiscTextNode nodes and MiscTextNode can contain more than text (any XML content). It contains just text if its property textChild holds TRUE. The following patch check there is only one MiscTextNode node and that it is really a text node. In all other cases it reports the fulle value of the AttributeValue node in the log.
-rw-r--r--auth_mellon_handler.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/auth_mellon_handler.c b/auth_mellon_handler.c
index 242530f..3f1698f 100644
--- a/auth_mellon_handler.c
+++ b/auth_mellon_handler.c
@@ -1667,14 +1667,26 @@ static int add_attributes(am_cache_entry_t *session, request_rec *r,
continue;
}
+ /* Verify there is only one node */
+ if (value->any->next != NULL) {
+ char *dump = lasso_node_dump(LASSO_NODE(value));
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
+ "AttributeValue element contained more "
+ "than one node: %s", dump);
+ g_free(dump);
+ continue;
+ }
/* Verify that this is a LassoMiscTextNode object. */
- if(!LASSO_IS_MISC_TEXT_NODE(value->any->data)) {
+ if(!LASSO_IS_MISC_TEXT_NODE(value->any->data) ||
+ !LASSO_MISC_TEXT_NODE(value->any->data)->text_child) {
+ char *dump = lasso_node_dump(LASSO_NODE(value));
ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
"AttributeValue element contained an "
- " element which wasn't a text node.");
+ " element which wasn't a text node: %s",
+ dump);
+ g_free(dump);
continue;
}
-
value_text = LASSO_MISC_TEXT_NODE(value->any->data);