Skip to content

Commit e3711af

Browse files
committed
Add ZPP checks in DOMNode::{__sleep,__wakeup}
Closes GH-13651.
1 parent 00f9c5e commit e3711af

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ PHP NEWS
66
. Fixed bug GH-13612 (Corrupted memory in destructor with weak references).
77
(nielsdos)
88

9+
- DOM:
10+
. Add some missing ZPP checks. (nielsdos)
11+
912
- Gettext:
1013
. Fixed sigabrt raised with dcgettext/dcngettext calls with gettext 0.22.5
1114
with category set to LC_ALL. (David Carlier)

ext/dom/node.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,12 +1797,20 @@ PHP_METHOD(DOMNode, getLineNo)
17971797

17981798
PHP_METHOD(DOMNode, __sleep)
17991799
{
1800+
if (zend_parse_parameters_none() != SUCCESS) {
1801+
RETURN_THROWS();
1802+
}
1803+
18001804
zend_throw_exception_ex(NULL, 0, "Serialization of '%s' is not allowed, unless serialization methods are implemented in a subclass", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
18011805
RETURN_THROWS();
18021806
}
18031807

18041808
PHP_METHOD(DOMNode, __wakeup)
18051809
{
1810+
if (zend_parse_parameters_none() != SUCCESS) {
1811+
RETURN_THROWS();
1812+
}
1813+
18061814
zend_throw_exception_ex(NULL, 0, "Unserialization of '%s' is not allowed, unless unserialization methods are implemented in a subclass", ZSTR_VAL(Z_OBJCE_P(ZEND_THIS)->name));
18071815
RETURN_THROWS();
18081816
}

0 commit comments

Comments
 (0)