diff options
author | Etienne Kneuss <colder@php.net> | 2008-12-22 14:11:49 +0000 |
---|---|---|
committer | Etienne Kneuss <colder@php.net> | 2008-12-22 14:11:49 +0000 |
commit | f48d22afa110265ad8edf32bed98c46a914b1b79 (patch) | |
tree | 6c10e0ef337e9c5304f950ebc4a30df182b9b5fe /Zend/zend_interfaces.c | |
parent | 3c1e53deb499f92607e345192868196d04d8b5e2 (diff) | |
download | php-git-f48d22afa110265ad8edf32bed98c46a914b1b79.tar.gz |
MFH: Fix #46646 (Implement zend functions to restrict serialization or internal classes)
Diffstat (limited to 'Zend/zend_interfaces.c')
-rwxr-xr-x | Zend/zend_interfaces.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c index b4edac5aee..a5a938e35b 100755 --- a/Zend/zend_interfaces.c +++ b/Zend/zend_interfaces.c @@ -463,6 +463,21 @@ ZEND_API int zend_user_unserialize(zval **object, zend_class_entry *ce, const un } /* }}} */ +ZEND_API int zend_class_serialize_deny(zval *object, unsigned char **buffer, zend_uint *buf_len, zend_serialize_data *data TSRMLS_DC) /* {{{ */ +{ + zend_class_entry *ce = Z_OBJCE_P(object); + zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Serialization of '%s' is not allowed", ce->name); + return FAILURE; +} +/* }}} */ + +ZEND_API int zend_class_unserialize_deny(zval **object, zend_class_entry *ce, const unsigned char *buf, zend_uint buf_len, zend_unserialize_data *data TSRMLS_DC) /* {{{ */ +{ + zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Unserialization of '%s' is not allowed", ce->name); + return FAILURE; +} +/* }}} */ + /* {{{ zend_implement_serializable */ static int zend_implement_serializable(zend_class_entry *interface, zend_class_entry *class_type TSRMLS_DC) { |