mirror of
https://github.com/php/php-src.git
synced 2025-01-24 20:53:37 +08:00
Beware of negative indices
This commit is contained in:
parent
b1bb6f1735
commit
1094a0d243
@ -83,7 +83,7 @@ static int var_access(php_unserialize_data_t *var_hashx, int id, zval ***store)
|
||||
|
||||
if (!var_hash) return !SUCCESS;
|
||||
|
||||
if (id >= var_hash->used_slots) return !SUCCESS;
|
||||
if (id < 0 || id >= var_hash->used_slots) return !SUCCESS;
|
||||
|
||||
*store = &var_hash->data[id];
|
||||
|
||||
|
@ -81,7 +81,7 @@ static int var_access(php_unserialize_data_t *var_hashx, int id, zval ***store)
|
||||
|
||||
if (!var_hash) return !SUCCESS;
|
||||
|
||||
if (id >= var_hash->used_slots) return !SUCCESS;
|
||||
if (id < 0 || id >= var_hash->used_slots) return !SUCCESS;
|
||||
|
||||
*store = &var_hash->data[id];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user