diff options
author | Rob Richards <rrichards@php.net> | 2004-02-16 13:06:33 +0000 |
---|---|---|
committer | Rob Richards <rrichards@php.net> | 2004-02-16 13:06:33 +0000 |
commit | 602c786aa9bd025c5cf37326c770a959cba57936 (patch) | |
tree | c9f9a9434c12d5f93680484f94107c5cb9399116 /ext/dom/processinginstruction.c | |
parent | 5dcf37b6188b8dcec92720f0a41151622a8dd7b9 (diff) | |
download | php-git-602c786aa9bd025c5cf37326c770a959cba57936.tar.gz |
issue warning if object is in invalid state when dealing with properties
Diffstat (limited to 'ext/dom/processinginstruction.c')
-rw-r--r-- | ext/dom/processinginstruction.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/dom/processinginstruction.c b/ext/dom/processinginstruction.c index c73d2d23ae..b17e11bc9b 100644 --- a/ext/dom/processinginstruction.c +++ b/ext/dom/processinginstruction.c @@ -86,6 +86,11 @@ int dom_processinginstruction_target_read(dom_object *obj, zval **retval TSRMLS_ nodep = dom_object_get_node(obj); + if (nodep == NULL) { + php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); + return FAILURE; + } + ALLOC_ZVAL(*retval); ZVAL_STRING(*retval, (char *) (nodep->name), 1); @@ -108,6 +113,11 @@ int dom_processinginstruction_data_read(dom_object *obj, zval **retval TSRMLS_DC nodep = dom_object_get_node(obj); + if (nodep == NULL) { + php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); + return FAILURE; + } + ALLOC_ZVAL(*retval); @@ -128,6 +138,11 @@ int dom_processinginstruction_data_write(dom_object *obj, zval *newval TSRMLS_DC nodep = dom_object_get_node(obj); + if (nodep == NULL) { + php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC); + return FAILURE; + } + if (newval->type != IS_STRING) { if(newval->refcount > 1) { value_copy = *newval; |