Skip to content

Commit ad7eeba

Browse files
committed
reverted changes for #62477
1 parent 896d0fc commit ad7eeba

File tree

5 files changed

+2
-46
lines changed

5 files changed

+2
-46
lines changed

NEWS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ PHP NEWS
204204
having had its dtor callback called in between). (Gustavo)
205205
. Fixed bug #61347 (inconsistent isset behavior of Arrayobject). (Laruence)
206206
. Fixed bug #61326 (ArrayObject comparison). (Gustavo)
207-
. Fixed bug #62477 LimitIterator int overflow. (Anatoliy)
208207

209208
- SQLite3 extension:
210209
. Add createCollation() method. (Brad Dewar)

ext/spl/spl_iterators.c

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,31 +1380,12 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
13801380
intern->dit_type = dit_type;
13811381
switch (dit_type) {
13821382
case DIT_LimitIterator: {
1383-
zval *tmp_offset, *tmp_count;
13841383
intern->u.limit.offset = 0; /* start at beginning */
13851384
intern->u.limit.count = -1; /* get all */
1386-
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|zz", &zobject, ce_inner, &tmp_offset, &tmp_count) == FAILURE) {
1385+
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "O|ll", &zobject, ce_inner, &intern->u.limit.offset, &intern->u.limit.count) == FAILURE) {
13871386
zend_restore_error_handling(&error_handling TSRMLS_CC);
13881387
return NULL;
13891388
}
1390-
if (tmp_offset && Z_TYPE_P(tmp_offset) != IS_NULL) {
1391-
if (Z_TYPE_P(tmp_offset) != IS_LONG) {
1392-
zend_throw_exception(spl_ce_OutOfRangeException, "offset param must be of type int", 0 TSRMLS_CC);
1393-
zend_restore_error_handling(&error_handling TSRMLS_CC);
1394-
return NULL;
1395-
} else {
1396-
intern->u.limit.offset = Z_LVAL_P(tmp_offset);
1397-
}
1398-
}
1399-
if (tmp_count && Z_TYPE_P(tmp_count) != IS_NULL) {
1400-
if (Z_TYPE_P(tmp_count) != IS_LONG) {
1401-
zend_throw_exception(spl_ce_OutOfRangeException, "count param must be of type int", 0 TSRMLS_CC);
1402-
zend_restore_error_handling(&error_handling TSRMLS_CC);
1403-
return NULL;
1404-
} else {
1405-
intern->u.limit.count = Z_LVAL_P(tmp_count);
1406-
}
1407-
}
14081389
if (intern->u.limit.offset < 0) {
14091390
zend_throw_exception(spl_ce_OutOfRangeException, "Parameter offset must be >= 0", 0 TSRMLS_CC);
14101391
zend_restore_error_handling(&error_handling TSRMLS_CC);

ext/spl/spl_iterators.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ typedef struct _spl_dual_it_object {
128128
uint str_key_len;
129129
ulong int_key;
130130
int key_type; /* HASH_KEY_IS_STRING or HASH_KEY_IS_LONG */
131-
long pos;
131+
int pos;
132132
} current;
133133
dual_it_type dit_type;
134134
union {

ext/spl/tests/bug62477_1.phpt

Lines changed: 0 additions & 12 deletions
This file was deleted.

ext/spl/tests/bug62477_2.phpt

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)