22Bug #77177 (Serializing or unserializing COM objects crashes)
33--EXTENSIONS--
44com_dotnet
5- --SKIPIF--
6- <?php
7- if (!class_exists ("dotnet " )) die ("skip mscoree not available " );
8- ?>
95--FILE--
106<?php
117$ com = new COM ("WScript.Shell " );
12- $ dotnet = new DOTNET ("mscorlib " , "System.Collections.Stack " );
138$ variant = new VARIANT ;
14- foreach ([$ com , $ dotnet , $ variant ] as $ object ) {
9+ foreach ([$ com , $ variant ] as $ object ) {
1510 try {
1611 serialize ($ object );
1712 } catch (Exception $ ex ) {
1813 echo "Exception: {$ ex ->getMessage ()}\n" ;
1914 }
2015}
2116
22- $ strings = ['C:3:"com":0:{} ' , 'C:6:"dotnet":0:{} ' , ' C: 7:"variant":0:{} ' ];
17+ $ strings = ['C:3:"com":0:{} ' , 'C:7:"variant":0:{} ' ];
2318foreach ($ strings as $ string ) {
2419 try {
2520 unserialize ($ string );
@@ -28,7 +23,7 @@ foreach ($strings as $string) {
2823 }
2924}
3025
31- $ strings = ['O:3:"com":0:{} ' , 'O:6:"dotnet":0:{} ' , ' O: 7:"variant":0:{} ' ];
26+ $ strings = ['O:3:"com":0:{} ' , 'O:7:"variant":0:{} ' ];
3227foreach ($ strings as $ string ) {
3328 try {
3429 unserialize ($ string );
@@ -37,13 +32,10 @@ foreach ($strings as $string) {
3732 }
3833}
3934?>
40- --EXPECTF --
35+ --EXPECT --
4136Exception: Serialization of 'com' is not allowed
42- Exception: Serialization of 'dotnet' is not allowed
4337Exception: Serialization of 'variant' is not allowed
4438Exception: Unserialization of 'com' is not allowed
45- Exception: Unserialization of 'dotnet' is not allowed
4639Exception: Unserialization of 'variant' is not allowed
4740Exception: Unserialization of 'com' is not allowed
48- Exception: Unserialization of 'dotnet' is not allowed
4941Exception: Unserialization of 'variant' is not allowed
0 commit comments