summaryrefslogtreecommitdiff
path: root/ext/dom/notation.c
diff options
context:
space:
mode:
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);