Skip to content

Commit 21f8bb6

Browse files
committed
add comp_flags check when passed as userland array option.
1 parent 7cc4125 commit 21f8bb6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/zip/php_zip.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ static zend_result php_zip_parse_options(HashTable *options, zip_options *opts)
374374
php_error_docref(NULL, E_WARNING, "Option \"comp_flags\" must be of type int, %s given",
375375
zend_zval_value_name(option));
376376
}
377+
zend_long comp_flags = zval_get_long(option);
378+
if (comp_flags < 0 || comp_flags > USHRT_MAX) {
379+
php_error_docref(NULL, E_WARNING, "Option \"comp_flags\" must be between 0 and %u", USHRT_MAX);
380+
}
377381
opts->comp_flags = zval_get_long(option);
378382
}
379383
}

0 commit comments

Comments
 (0)