summaryrefslogtreecommitdiff
path: root/ext/com_dotnet/tests
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-10-22 17:50:22 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-10-26 11:48:57 +0100
commit7424bfc7ac772687a681e42081ea0d8943f0d85e (patch)
tree531ad48925e9908afeec9f58564d454076b929c9 /ext/com_dotnet/tests
parent848e24f24d7c05db04fe1ba87e6566a5c30323fd (diff)
downloadphp-git-7424bfc7ac772687a681e42081ea0d8943f0d85e.tar.gz
Fix #62474: com_event_sink crashes on certain arguments
We have to make sure that the variant is of type `VT_DISPATCH` before we access it as such. Closes GH-6372.
Diffstat (limited to 'ext/com_dotnet/tests')
-rw-r--r--ext/com_dotnet/tests/bug62474.phpt14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/com_dotnet/tests/bug62474.phpt b/ext/com_dotnet/tests/bug62474.phpt
new file mode 100644
index 0000000000..cc8e252224
--- /dev/null
+++ b/ext/com_dotnet/tests/bug62474.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Bug #62474 (com_event_sink crashes on certain arguments)
+--SKIPIF--
+<?php
+if (!extension_loaded('com_dotnet')) die('skip com_dotnet extension not available');
+?>
+--FILE--
+<?php
+var_dump(com_event_sink(new variant, function() {}, array()));
+var_dump(com_event_sink(new variant, new variant, 'a'));
+?>
+--EXPECT--
+bool(false)
+bool(false)