Skip to content

Soap segfault when classmap instantiation fails #16259

Closed

Description

@YuanchengJiang

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/php_encoding.c:1206:23

PHP Version

PHP 8.4.0-dev

Operating System

ubuntu 22.04

Activity

  1. ndossche commented on Oct 6, 2024

    @ndossche
    Member

    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.

  2. self-assigned this
    on Oct 6, 2024
  3. ndossche commented on Oct 6, 2024

    @ndossche
    Member

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

  4. changed the title [-]Segmentation fault in ext/soap/php_encoding.c:1206[/-] [+]Soap segfault when classmap instantiation fails[/+] on Oct 6, 2024
  5. added a commit that references this issue on Oct 6, 2024
    52c5376
  6. added 3 commits that reference this issue on Oct 7, 2024
    71222f7
    932406a
    82d58c4
  7. added a commit that references this issue on Oct 7, 2024
    0d564de
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions