diff options
| author | Christian Stocker <chregu@php.net> | 2003-01-06 08:48:38 +0000 |
|---|---|---|
| committer | Christian Stocker <chregu@php.net> | 2003-01-06 08:48:38 +0000 |
| commit | 1fcbd36e6df7ea5797e8c86dfb9b1c49aa343b06 (patch) | |
| tree | 5a095cd7abcd4da3c31c378c6c6a3cc8d38ce4d2 /ext/domxml/php_domxml.c | |
| parent | 7be4d4640ae9df4c96d709549053eae423e65036 (diff) | |
| download | php-git-1fcbd36e6df7ea5797e8c86dfb9b1c49aa343b06.tar.gz | |
partly MFH from 1.288 (Fixed segfault, when trying to add a node to itself)
Diffstat (limited to 'ext/domxml/php_domxml.c')
| -rw-r--r-- | ext/domxml/php_domxml.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index 0a58581316..38b407d186 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -2296,6 +2296,12 @@ PHP_FUNCTION(domxml_node_append_child) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't append attribute node"); RETURN_FALSE; } + + /* XXX:ls */ + if (child == parent) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't append node to itself"); + RETURN_FALSE; + } if (!(child->doc == NULL || child->doc == parent->doc)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't append node, which is in a different document than the parent node"); |
