8000 Soap segfault when classmap instantiation fails · Issue #16259 · php/php-src · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Soap segfault when classmap instantiation fails #16259

Closed
YuanchengJiang opened this issue Oct 6, 2024 · 2 comments
Closed

Soap segfault when classmap instantiation fails #16259

YuanchengJiang opened this issue Oct 6, 2024 · 2 comments

Comments

@YuanchengJiang
Copy link

Description

The following code:

<?php
abstract class CT_A1 {
}
class CT_A2 extends CT_A1 {
}
$classMap = array("A1" => "CT_A1", "A2" => "CT_A2", "A3" => "CT_A3");
$client = new SoapClient(__DIR__."/bug36575.wsdl", array("trace" => 1, "exceptions" => 0, "classmap" => $fusion));
$a2 = new CT_A2();
$client->test($a2);
$soapRequest = $client->__getLastRequest();
$server = new SoapServer(__DIR__."/bug36575.wsdl", array("classmap" => $classMap));
$server->handle($soapRequest);

Resulted in this output:

/php-src/ext/soap/php_encoding.c:1206:23: runtime error: member access within null pointer of type 'zend_object' (aka 'struct _zend_object')
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/soap/ph
8000
p_encoding.c:1206:23

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

@nielsdos
Copy link
Member
nielsdos commented Oct 6, 2024

We need to check for ZEND_ACC_UNINSTANTIABLE in the class map, will fix this once #16269 is merged so I don't have to deal with merge conflicts.

@nielsdos nielsdos self-assigned this Oct 6, 2024
@nielsdos
Copy link
Member
nielsdos commented Oct 6, 2024

Actaually, there's other cases that can fail too, so we should just add a runtime check.

@nielsdos nielsdos changed the title Segmentation fault in ext/soap/php_encoding.c:1206 Soap segfault when classmap instantiation fails Oct 6, 2024
nielsdos added a commit to nielsdos/php-src that referenced this issue Oct 6, 2024
Instantiation failure checks were missing.
nielsdos added a commit that referenced this issue Oct 7, 2024
* PHP-8.2:
  Fix GH-16259: Soap segfault when classmap instantiation fails
nielsdos added a commit that referenced this issue Oct 7, 2024
* PHP-8.3:
  Fix GH-16259: Soap segfault when classmap instantiation fails
nielsdos added a commit that referenced this issue Oct 7, 2024
* PHP-8.4:
  Fix GH-16259: Soap segfault when classmap instantiation fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0