summaryrefslogtreecommitdiff
path: root/ext/simplexml/simplexml.c
diff options
context:
space:
mode:
authorSterling Hughes <sterling@php.net>2003-11-03 13:36:23 +0000
committerSterling Hughes <sterling@php.net>2003-11-03 13:36:23 +0000
commite963f0b168da188d7119c3a0725ea400fa2d9b07 (patch)
tree90181cd632e188755fc961db58cd6633aacdbccc /ext/simplexml/simplexml.c
parentb763dd42c34e6f37df104032206af1f4fe55681c (diff)
downloadphp-git-e963f0b168da188d7119c3a0725ea400fa2d9b07.tar.gz
- Stop a crash in xpath
- Remove the ability to access attributes via the -> operator, attributes are accessed via the array indicators
Diffstat (limited to 'ext/simplexml/simplexml.c')
-rw-r--r--ext/simplexml/simplexml.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 603eab5164..e7eafa32d9 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -227,7 +227,7 @@ next_iter:
static zval *
sxe_property_read(zval *object, zval *member, zend_bool silent TSRMLS_DC)
{
- return sxe_prop_dim_read(object, member, 1, 1, silent TSRMLS_CC);
+ return sxe_prop_dim_read(object, member, 1, 0, silent TSRMLS_CC);
}
/* }}} */
@@ -634,6 +634,7 @@ simplexml_ce_xpath_search(INTERNAL_FUNCTION_PARAMETERS)
char *query;
int query_len;
int i;
+ xmlXPathObjectPtr retval;
xmlNodeSetPtr result;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
@@ -650,7 +651,13 @@ simplexml_ce_xpath_search(INTERNAL_FUNCTION_PARAMETERS)
sxe->xpath->node = sxe->node->node;
- result = xmlXPathEval(query, sxe->xpath)->nodesetval;
+ retval = xmlXPathEval(query, sxe->xpath);
+ if (!retval) {
+ RETURN_FALSE;
+ }
+
+
+ result = retval->nodesetval;
if (!result) {
RETURN_FALSE;
}