Skip to content

Commit 5f42a46

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: random: Fix check before closing `random_fd` (#10247)
2 parents 1b3e175 + 32f503e commit 5f42a46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/random/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ static PHP_GINIT_FUNCTION(random)
827827
/* {{{ PHP_GSHUTDOWN_FUNCTION */
828828
static PHP_GSHUTDOWN_FUNCTION(random)
829829
{
830-
if (random_globals->random_fd > 0) {
830+
if (random_globals->random_fd >= 0) {
831831
close(random_globals->random_fd);
832832
random_globals->random_fd = -1;
833833
}

0 commit comments

Comments
 (0)