-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathp01.patch
42 lines (38 loc) · 1.87 KB
/
p01.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--- /home/vagrant/SemanticCrashBucketing/src/complete/php-7.0.14/ground-truth/php/source/7.0.14/ext/wddx/wddx.c
+++ /home/vagrant/SemanticCrashBucketing/src/complete/php-7.0.14/ground-truth/php/source/7.0.14/ext/wddx/wddx.c
@@ -967,22 +967,26 @@
php_error_docref(NULL, E_WARNING, "Class %s can not be unserialized", Z_STRVAL(ent1->data));
} else {
/* Initialize target object */
- object_init_ex(&obj, pce);
+ if (object_init_ex(&obj, pce) != SUCCESS || EG(exception)) {
+ zval_ptr_dtor(&ent2->data);
+ ZVAL_UNDEF(&ent2->data);
+ php_error_docref(NULL, E_WARNING, "Class %s can not be instantiated", Z_STRVAL(ent1->data));
+ } else {
+ /* Merge current hashtable with object's default properties */
+ zend_hash_merge(Z_OBJPROP(obj),
+ Z_ARRVAL(ent2->data),
+ zval_add_ref, 0);
- /* Merge current hashtable with object's default properties */
- zend_hash_merge(((obj.value.obj)->handlers)->get_properties(&(obj)),
- Z_ARRVAL(ent2->data),
- zval_add_ref, 0);
+ if (incomplete_class) {
+ php_store_class_name(&obj, Z_STRVAL(ent1->data), Z_STRLEN(ent1->data));
+ }
- if (incomplete_class) {
- php_store_class_name(&obj, Z_STRVAL(ent1->data), Z_STRLEN(ent1->data));
- }
+ /* Clean up old array entry */
+ zval_ptr_dtor(&ent2->data);
- /* Clean up old array entry */
- zval_ptr_dtor(&ent2->data);
-
- /* Set stack entry to point to the newly created object */
- ZVAL_COPY_VALUE(&ent2->data, &obj);
+ /* Set stack entry to point to the newly created object */
+ ZVAL_COPY_VALUE(&ent2->data, &obj);
+ }
}
/* Clean up class name var entry */