diff options
| -rw-r--r-- | execute.c | 7 | ||||
| -rw-r--r-- | session.c | 3 | ||||
| -rw-r--r-- | tests/filter/input_filter_request_array_index_blacklist.phpt | 2 | ||||
| -rw-r--r-- | tests/filter/input_filter_request_array_index_whitelist.phpt | 2 | ||||
| -rw-r--r-- | tests/filter/post_fileupload_array_index_blacklist.phpt | 2 | ||||
| -rw-r--r-- | tests/filter/post_fileupload_array_index_whitelist.phpt | 2 |
6 files changed, 10 insertions, 8 deletions
| @@ -377,7 +377,7 @@ static int suhosin_detect_codetype(zend_op_array *op_array TSRMLS_DC) | |||
| 377 | 377 | ||
| 378 | /* {{{ void suhosin_execute_ex(zend_op_array *op_array TSRMLS_DC) | 378 | /* {{{ void suhosin_execute_ex(zend_op_array *op_array TSRMLS_DC) |
| 379 | * This function provides a hook for execution */ | 379 | * This function provides a hook for execution */ |
| 380 | #if PHP_VERSION_ID > 50500 | 380 | #if PHP_VERSION_ID >= 50500 |
| 381 | static void suhosin_execute_ex(zend_execute_data *execute_data TSRMLS_DC) | 381 | static void suhosin_execute_ex(zend_execute_data *execute_data TSRMLS_DC) |
| 382 | { | 382 | { |
| 383 | zend_op_array *op_array = execute_data->op_array; | 383 | zend_op_array *op_array = execute_data->op_array; |
| @@ -674,7 +674,7 @@ int ih_preg_replace(IH_HANDLER_PARAMS) | |||
| 674 | **limit, **zcount; | 674 | **limit, **zcount; |
| 675 | 675 | ||
| 676 | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ|ZZ", ®ex, &replace, &subject, &limit, &zcount) == FAILURE) { | 676 | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ZZZ|ZZ", ®ex, &replace, &subject, &limit, &zcount) == FAILURE) { |
| 677 | return(0); | 677 | return (1); |
| 678 | } | 678 | } |
| 679 | 679 | ||
| 680 | if (Z_TYPE_PP(regex) == IS_ARRAY) { | 680 | if (Z_TYPE_PP(regex) == IS_ARRAY) { |
| @@ -1529,8 +1529,9 @@ static int ih_rand(IH_HANDLER_PARAMS) | |||
| 1529 | static int ih_getrandmax(IH_HANDLER_PARAMS) | 1529 | static int ih_getrandmax(IH_HANDLER_PARAMS) |
| 1530 | { | 1530 | { |
| 1531 | if (zend_parse_parameters_none() == FAILURE) { | 1531 | if (zend_parse_parameters_none() == FAILURE) { |
| 1532 | return(0); | 1532 | return (1); |
| 1533 | } | 1533 | } |
| 1534 | |||
| 1534 | RETVAL_LONG(PHP_MT_RAND_MAX); | 1535 | RETVAL_LONG(PHP_MT_RAND_MAX); |
| 1535 | return (1); | 1536 | return (1); |
| 1536 | } | 1537 | } |
| @@ -339,7 +339,7 @@ void suhosin_hook_session(TSRMLS_D) | |||
| 339 | 339 | ||
| 340 | /* increase session identifier entropy */ | 340 | /* increase session identifier entropy */ |
| 341 | if (SESSION_G(entropy_length) == 0 || SESSION_G(entropy_file) == NULL) { | 341 | if (SESSION_G(entropy_length) == 0 || SESSION_G(entropy_file) == NULL) { |
| 342 | 342 | #ifndef PHP_WIN32 | |
| 343 | /* ensure that /dev/urandom exists */ | 343 | /* ensure that /dev/urandom exists */ |
| 344 | int fd = VCWD_OPEN("/dev/urandom", O_RDONLY); | 344 | int fd = VCWD_OPEN("/dev/urandom", O_RDONLY); |
| 345 | if (fd >= 0) { | 345 | if (fd >= 0) { |
| @@ -347,6 +347,7 @@ void suhosin_hook_session(TSRMLS_D) | |||
| 347 | SESSION_G(entropy_length) = 16; | 347 | SESSION_G(entropy_length) = 16; |
| 348 | SESSION_G(entropy_file) = pestrdup("/dev/urandom", 1); | 348 | SESSION_G(entropy_file) = pestrdup("/dev/urandom", 1); |
| 349 | } | 349 | } |
| 350 | #endif | ||
| 350 | } | 351 | } |
| 351 | } | 352 | } |
| 352 | 353 | ||
diff --git a/tests/filter/input_filter_request_array_index_blacklist.phpt b/tests/filter/input_filter_request_array_index_blacklist.phpt index ead85c5..d85c2e9 100644 --- a/tests/filter/input_filter_request_array_index_blacklist.phpt +++ b/tests/filter/input_filter_request_array_index_blacklist.phpt | |||
| @@ -10,7 +10,7 @@ suhosin.log.file.name={PWD}/suhosintest.$$.log.tmp | |||
| 10 | auto_append_file={PWD}/suhosintest.$$.log.tmp | 10 | auto_append_file={PWD}/suhosintest.$$.log.tmp |
| 11 | suhosin.request.array_index_blacklist="=ABC%{}\\$;" | 11 | suhosin.request.array_index_blacklist="=ABC%{}\\$;" |
| 12 | --SKIPIF-- | 12 | --SKIPIF-- |
| 13 | <?php include('skipif.inc'); ?> | 13 | <?php include('../skipif.inc'); ?> |
| 14 | --COOKIE-- | 14 | --COOKIE-- |
| 15 | var1[aaa]=1;var2[bbB]=1;var3[ccc][ccC]=1 | 15 | var1[aaa]=1;var2[bbB]=1;var3[ccc][ccC]=1 |
| 16 | --GET-- | 16 | --GET-- |
diff --git a/tests/filter/input_filter_request_array_index_whitelist.phpt b/tests/filter/input_filter_request_array_index_whitelist.phpt index a091574..131ad42 100644 --- a/tests/filter/input_filter_request_array_index_whitelist.phpt +++ b/tests/filter/input_filter_request_array_index_whitelist.phpt | |||
| @@ -10,7 +10,7 @@ suhosin.log.file.name={PWD}/suhosintest.$$.log.tmp | |||
| 10 | auto_append_file={PWD}/suhosintest.$$.log.tmp | 10 | auto_append_file={PWD}/suhosintest.$$.log.tmp |
| 11 | suhosin.request.array_index_whitelist=abcdefghijklmnopqrstuvwxyz | 11 | suhosin.request.array_index_whitelist=abcdefghijklmnopqrstuvwxyz |
| 12 | --SKIPIF-- | 12 | --SKIPIF-- |
| 13 | <?php include('skipif.inc'); ?> | 13 | <?php include('../skipif.inc'); ?> |
| 14 | --COOKIE-- | 14 | --COOKIE-- |
| 15 | var1[aaa]=1;var2[bbB]=1;var3[ccc][ccC]=1 | 15 | var1[aaa]=1;var2[bbB]=1;var3[ccc][ccC]=1 |
| 16 | --GET-- | 16 | --GET-- |
diff --git a/tests/filter/post_fileupload_array_index_blacklist.phpt b/tests/filter/post_fileupload_array_index_blacklist.phpt index 7e19014..2bf0a57 100644 --- a/tests/filter/post_fileupload_array_index_blacklist.phpt +++ b/tests/filter/post_fileupload_array_index_blacklist.phpt | |||
| @@ -11,7 +11,7 @@ auto_append_file={PWD}/suhosintest.$$.log.tmp | |||
| 11 | file_uploads=1 | 11 | file_uploads=1 |
| 12 | suhosin.request.array_index_blacklist=ABC | 12 | suhosin.request.array_index_blacklist=ABC |
| 13 | --SKIPIF-- | 13 | --SKIPIF-- |
| 14 | <?php include('skipif.inc'); ?> | 14 | <?php include('../skipif.inc'); ?> |
| 15 | --COOKIE-- | 15 | --COOKIE-- |
| 16 | --GET-- | 16 | --GET-- |
| 17 | --POST_RAW-- | 17 | --POST_RAW-- |
diff --git a/tests/filter/post_fileupload_array_index_whitelist.phpt b/tests/filter/post_fileupload_array_index_whitelist.phpt index b910c44..f76aeb3 100644 --- a/tests/filter/post_fileupload_array_index_whitelist.phpt +++ b/tests/filter/post_fileupload_array_index_whitelist.phpt | |||
| @@ -11,7 +11,7 @@ auto_append_file={PWD}/suhosintest.$$.log.tmp | |||
| 11 | file_uploads=1 | 11 | file_uploads=1 |
| 12 | suhosin.request.array_index_whitelist=abcdefghijklmnopqrstuvwxyz | 12 | suhosin.request.array_index_whitelist=abcdefghijklmnopqrstuvwxyz |
| 13 | --SKIPIF-- | 13 | --SKIPIF-- |
| 14 | <?php include('skipif.inc'); ?> | 14 | <?php include('../skipif.inc'); ?> |
| 15 | --COOKIE-- | 15 | --COOKIE-- |
| 16 | --GET-- | 16 | --GET-- |
| 17 | --POST_RAW-- | 17 | --POST_RAW-- |
