Beware of negative indices

This commit is contained in:
Stefan Esser 2004-12-01 22:42:00 +00:00
parent b1bb6f1735
commit 1094a0d243
2 changed files with 2 additions and 2 deletions

View File

@ -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];

View File

@ -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];