summaryrefslogtreecommitdiff
path: root/ext/dom/notation.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2004-02-16 13:06:33 (GMT)
committerRob Richards <rrichards@php.net>2004-02-16 13:06:33 (GMT)
commit602c786aa9bd025c5cf37326c770a959cba57936 (patch)
treec9f9a9434c12d5f93680484f94107c5cb9399116 /ext/dom/notation.c
parent5dcf37b6188b8dcec92720f0a41151622a8dd7b9 (diff)
downloadphp-602c786aa9bd025c5cf37326c770a959cba57936.tar.gz
issue warning if object is in invalid state when dealing with properties
Diffstat (limited to 'ext/dom/notation.c')
-rw-r--r--ext/dom/notation.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/dom/notation.c b/ext/dom/notation.c
index 01e8f6d..f43d6ae 100644
--- a/ext/dom/notation.c
+++ b/ext/dom/notation.c
@@ -51,6 +51,12 @@ int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC)
xmlNotationPtr nodep;
nodep = (xmlNotationPtr) dom_object_get_node(obj);
+
+ if (nodep == NULL) {
+ php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ return FAILURE;
+ }
+
ALLOC_ZVAL(*retval);
if (nodep->PublicID) {
ZVAL_STRING(*retval, (char *) (nodep->PublicID), 1);
@@ -75,6 +81,12 @@ int dom_notation_system_id_read(dom_object *obj, zval **retval TSRMLS_DC)
xmlNotationPtr nodep;
nodep = (xmlNotationPtr) dom_object_get_node(obj);
+
+ if (nodep == NULL) {
+ php_dom_throw_error(INVALID_STATE_ERR, 0 TSRMLS_CC);
+ return FAILURE;
+ }
+
ALLOC_ZVAL(*retval);
if (nodep->SystemID) {
ZVAL_STRING(*retval, (char *) (nodep->PublicID), 1);