Skip to content

Commit 2a0931d

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix phpGH-19798: XP_SOCKET XP_SSL: Incorrect condition for Win
2 parents 42787fe + eef11e0 commit 2a0931d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ PHP NEWS
7575
. Partially fixed bug GH-16317 (SimpleXML does not allow __debugInfo() overrides
7676
to work). (nielsdos)
7777

78+
- Streams:
79+
. Fixed bug GH-19798: XP_SOCKET XP_SSL (Socket stream modules): Incorrect
80+
condition for Win32/Win64. (Jakub Zelenka)
81+
7882
- Tidy:
7983
. Fixed GH-19021 (improved tidyOptGetCategory detection).
8084
(arjendekorte, David Carlier, Peter Kokot)

ext/openssl/xp_ssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,7 +2338,7 @@ static int php_openssl_sockop_stat(php_stream *stream, php_stream_statbuf *ssb)
23382338
static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_netstream_data_t *sock,
23392339
php_stream_xport_param *xparam STREAMS_DC) /* {{{ */
23402340
{
2341-
int clisock;
2341+
php_socket_t clisock;
23422342
bool nodelay = 0;
23432343
zval *tmpzval = NULL;
23442344

@@ -2359,7 +2359,7 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_
23592359
&xparam->outputs.error_code,
23602360
nodelay);
23612361

2362-
if (clisock >= 0) {
2362+
if (clisock != SOCK_ERR) {
23632363
php_openssl_netstream_data_t *clisockdata = (php_openssl_netstream_data_t*) emalloc(sizeof(*clisockdata));
23642364

23652365
/* copy underlying tcp fields */

main/streams/xp_socket.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ static inline int php_tcp_sockop_connect(php_stream *stream, php_netstream_data_
858858
static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t *sock,
859859
php_stream_xport_param *xparam STREAMS_DC)
860860
{
861-
int clisock;
861+
php_socket_t clisock;
862862
bool nodelay = 0;
863863
zval *tmpzval = NULL;
864864

@@ -879,7 +879,7 @@ static inline int php_tcp_sockop_accept(php_stream *stream, php_netstream_data_t
879879
&xparam->outputs.error_code,
880880
nodelay);
881881

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

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

0 commit comments

Comments
 (0)