Skip to content

Commit

Permalink
Also reject negative format values in APCuIterator
Browse files Browse the repository at this point in the history
This would affect applications that accidentally or deliberately pass in
negative values for $format (e.g. PHP_INT_MIN on 64-bit builds)
  • Loading branch information
TysonAndre committed Nov 13, 2022
1 parent eb6b9bd commit 8d0cd82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apc_iterator.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static void apc_iterator_totals(apc_iterator_t *iterator) {
}
/* }}} */

void apc_iterator_obj_init(apc_iterator_t *iterator, zval *search, zend_long format, size_t chunk_size, zend_long list)
void apc_iterator_obj_init(apc_iterator_t *iterator, zval *search, zend_ulong format, size_t chunk_size, zend_long list)
{
if (!APCG(enabled)) {
zend_throw_error(NULL, "APC must be enabled to use APCUIterator");
Expand Down
2 changes: 1 addition & 1 deletion apc_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/* {{{ apc_iterator_t */
typedef struct _apc_iterator_t {
short int initialized; /* sanity check in case __construct failed */
zend_long format; /* format bitmask of the return values ie: key, value, info */
zend_ulong format; /* format bitmask of the return values ie: key, value, info */
size_t (*fetch)(struct _apc_iterator_t *iterator);
/* fetch callback to fetch items from cache slots or lists */
size_t slot_idx; /* index to the slot array or linked list */
Expand Down

0 comments on commit 8d0cd82

Please sign in to comment.