Skip to content

Commit 9d4a9ad

Browse files
committed
Merge branch 'PHP-7.4'
2 parents 52d31bf + 518c651 commit 9d4a9ad

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

ext/standard/http_fopen_wrapper.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,10 @@ static inline void strip_header(char *header_bag, char *lc_header_bag,
8686
const char *lc_header_name)
8787
{
8888
char *lc_header_start = strstr(lc_header_bag, lc_header_name);
89-
char *header_start = header_bag + (lc_header_start - lc_header_bag);
90-
9189
if (lc_header_start
9290
&& (lc_header_start == lc_header_bag || *(lc_header_start-1) == '\n')
9391
) {
92+
char *header_start = header_bag + (lc_header_start - lc_header_bag);
9493
char *lc_eol = strchr(lc_header_start, '\n');
9594
char *eol = header_start + (lc_eol - lc_header_start);
9695

ext/standard/random.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ PHPAPI int php_random_int(zend_long min, zend_long max, zend_long *result, zend_
235235
return SUCCESS;
236236
}
237237

238-
umax = max - min;
238+
umax = (zend_ulong) max - (zend_ulong) min;
239239

240240
if (php_random_bytes(&trial, sizeof(trial), should_throw) == FAILURE) {
241241
return FAILURE;

ext/standard/tests/random/random_int.phpt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@
22
Test normal operation of random_int()
33
--FILE--
44
<?php
5-
//-=-=-=-
65

76
var_dump(is_int(random_int(10, 100)));
87

98
$x = random_int(10, 100);
109
var_dump($x >= 10 && $x <= 100);
1110

1211
var_dump(random_int(-1000, -1) < 0);
12+
var_dump(random_int(-1, PHP_INT_MAX) >= -1);
13+
var_dump(is_int(random_int(PHP_INT_MIN, PHP_INT_MAX)));
1314

1415
var_dump(random_int(42,42));
1516

1617
?>
17-
--EXPECT--
18+
--EXPECTF--
19+
bool(true)
20+
bool(true)
1821
bool(true)
1922
bool(true)
2023
bool(true)

0 commit comments

Comments
 (0)