Skip to content

Commit

Permalink
Fixed issue #68
Browse files Browse the repository at this point in the history
  • Loading branch information
laruence committed Dec 27, 2019
1 parent b5a4c7a commit 7abaec6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions taint.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ static zval *php_taint_fetch_dimension_address_inner(HashTable *ht, const zval *
default:
zend_error(E_WARNING, "Illegal offset type");
retval = (type == BP_VAR_W || type == BP_VAR_RW) ?
#if PHP_7_0
#if PHP_VERSION_ID < 70100
&EG(error_zval)
#else
NULL
Expand All @@ -286,7 +286,7 @@ static void php_taint_fetch_dimension_address(zval *result, zval *container, zva
retval = zend_hash_next_index_insert(Z_ARRVAL_P(container), &EG(uninitialized_zval));
if (UNEXPECTED(retval == NULL)) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
#if PHP_7_0
#if PHP_VERSION_ID < 70100
retval = &EG(error_zval);
#else
ZVAL_ERROR(result);
Expand Down Expand Up @@ -315,14 +315,14 @@ static void php_taint_fetch_dimension_address(zval *result, zval *container, zva

if (dim == NULL) {
zend_throw_error(NULL, "[] operator not supported for strings");
#if PHP_7_0
#if PHP_VERSION_ID < 70100
ZVAL_INDIRECT(result, &EG(error_zval));
#else
ZVAL_ERROR(result);
#endif
} else {
php_taint_check_string_offset(dim, type);
#if PHP_7_0
#if PHP_VERSION_ID < 70100
ZVAL_INDIRECT(result, NULL); /* wrong string offset */
#else
ZVAL_ERROR(result);
Expand All @@ -331,7 +331,7 @@ static void php_taint_fetch_dimension_address(zval *result, zval *container, zva
} else if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (!Z_OBJ_HT_P(container)->read_dimension) {
zend_throw_error(NULL, "Cannot use object as array");
#if PHP_7_0
#if PHP_VERSION_ID < 70100
retval = &EG(error_zval);
#else
ZVAL_ERROR(result);
Expand Down Expand Up @@ -368,7 +368,7 @@ static void php_taint_fetch_dimension_address(zval *result, zval *container, zva
ZVAL_INDIRECT(result, retval);
}
} else {
#if PHP_7_0
#if PHP_VERSION_ID < 70100
ZVAL_INDIRECT(result, &EG(error_zval));
#else
ZVAL_ERROR(result);
Expand All @@ -377,7 +377,7 @@ static void php_taint_fetch_dimension_address(zval *result, zval *container, zva
}
} else if (EXPECTED(Z_TYPE_P(container) <= IS_FALSE)) {
if (UNEXPECTED(TAINT_ISERR(container))) {
#if PHP_7_0
#if PHP_VERSION_ID < 70100
ZVAL_INDIRECT(result, &EG(error_zval));
#else
ZVAL_ERROR(result);
Expand All @@ -394,7 +394,7 @@ static void php_taint_fetch_dimension_address(zval *result, zval *container, zva
ZVAL_NULL(result);
} else {
zend_error(E_WARNING, "Cannot use a scalar value as an array");
#if PHP_7_0
#if PHP_VERSION_ID < 70100
ZVAL_INDIRECT(result, &EG(error_zval));
#else
ZVAL_ERROR(result);
Expand Down

0 comments on commit 7abaec6

Please sign in to comment.