Skip to content

Commit 4545174

Browse files
committed
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Fix phpGH-19798: XP_SOCKET XP_SSL: Incorrect condition for Win
2 parents d378dce + 2a0931d commit 4545174

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ PHP NEWS
1010
. Fixed bug GH-20257 (mail() heap overflow with an empty message in lf mode).
1111
(David Carlier)
1212

13+
- Streams:
14+
. Fixed bug GH-19798: XP_SOCKET XP_SSL (Socket stream modules): Incorrect
15+
condition for Win32/Win64. (Jakub Zelenka)
16+
17+
1318
23 Oct 2025, PHP 8.5.0RC3
1419

1520
- Core:

ext/openssl/xp_ssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2219,7 +2219,7 @@ static int php_openssl_sockop_stat(php_stream *stream, php_stream_statbuf *ssb)
22192219
static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_netstream_data_t *sock,
22202220
php_stream_xport_param *xparam STREAMS_DC) /* {{{ */
22212221
{
2222-
int clisock;
2222+
php_socket_t clisock;
22232223
bool nodelay = 0;
22242224
zval *tmpzval = NULL;
22252225

@@ -2240,7 +2240,7 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_
22402240
&xparam->outputs.error_code,
22412241
nodelay);
22422242

2243-
if (clisock >= 0) {
2243+
if (clisock != SOCK_ERR) {
22442244
php_openssl_netstream_data_t *clisockdata = (php_openssl_netstream_data_t*) emalloc(sizeof(*clisockdata));
22452245

22462246
/* copy underlying tcp fields */

main/streams/xp_socket.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t
878878
&xparam->outputs.error_code,
879879
nodelay);
880880

881-
if (clisock >= 0) {
881+
if (clisock != SOCK_ERR) {
882882
php_netstream_data_t *clisockdata = (php_netstream_data_t*) emalloc(sizeof(*clisockdata));
883883

884884
memcpy(clisockdata, sock, sizeof(*clisockdata));

0 commit comments

Comments
 (0)