[php-src] Issue #20802: Segfault when bad type SNI_server_cert passed in
[email protected] (dixyes)
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Issue: https://github.com/php/php-src/issues/20802
Author: dixyes
### Description
server:
```php
<?php
$context = stream_context_create([
'ssl' => [
'SNI_enabled' => true,
'SNI_server_certs' => [
'localhost' => false, // not a string/array
],
],
]);
$stream = stream_socket_server('tls://0.0.0.0:12443', $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN, $context);
$conn = stream_socket_accept($stream);
```
connect with:
```bash
openssl s_client -debug 127.0.0.1:12443
```
missing check here:
https://github.com/php/php-src/blob/434b14e4a3001c3b23607df0c80478d72e4ac2c8/ext/openssl/xp_ssl.c#L1435-L1437
### PHP Version
```plain
master
```
### Operating System
_No response_