Skip to content

Commit e181560

Browse files
mheijkoopSean-Der
authored andcommitted
match type of var_entries.used_slots
`used_slots` and iteration variable `i` did not use matching types causing crashes this fixes this and changes the types to `zend_long` to match the same struct used in var_unserializer.c in PHP.
1 parent e932088 commit e181560

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

msgpack_unpack.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
typedef struct {
1313
zval data[VAR_ENTRIES_MAX];
14-
int32_t used_slots;
14+
zend_long used_slots;
1515
void *next;
1616
} var_entries;
1717

@@ -98,7 +98,7 @@ static inline void msgpack_var_replace(zval *old, zval *new) /* {{{ */ {
9898
}
9999
/* }}} */
100100

101-
static zval *msgpack_var_access(msgpack_unserialize_data_t *var_hashx, long id) /* {{{ */ {
101+
static zval *msgpack_var_access(msgpack_unserialize_data_t *var_hashx, zend_long id) /* {{{ */ {
102102
var_entries *var_hash = var_hashx->first;
103103

104104
while (id >= VAR_ENTRIES_MAX && var_hash && var_hash->used_slots == VAR_ENTRIES_MAX) {
@@ -280,7 +280,7 @@ void msgpack_unserialize_var_init(msgpack_unserialize_data_t *var_hashx) /* {{{
280280
/* }}} */
281281

282282
void msgpack_unserialize_var_destroy(msgpack_unserialize_data_t *var_hashx, zend_bool err) /* {{{ */ {
283-
size_t i;
283+
zend_long i;
284284
void *next;
285285
var_entries *var_hash = var_hashx->first;
286286

0 commit comments

Comments
 (0)