* master: (41 commits)
fix test - output can be chunked
fix test
fix test
Fixed test for commit
997be125eb0228c5b1b6dd278f617791e71192c6
Add bug fix to NEWS
Update UPGRADING according to bug fix
fix test
improve CURL tests to allow testing without separate server
improve CURL tests to allow testing without separate server
Fixed bug #67199 mb_regex_encoding mishmash
Fix bug #67248 (imageaffinematrixget missing check of parameters)
Fix bug #67247 spl_fixedarray_resize integer overflow
fix news
add tests stuff to README
Updated NEWS
Fix Linux specific fail in error traces (cherry-picked and fix for bug #67245) Linux apparently does not like memcpy in overlapping regions...
- Fixed off-by-one in phar_build (patch by crrodriguez at opensuse dot org)
- Move checking
- Fixed missing NULL check in SimpleXMLElement::xpath()
- Fixed missing NULL check
...
Conflicts:
ext/bz2/bz2.c
ext/gd/gd.c
ext/mbstring/php_mbregex.c
ext/session/tests/031.phpt
ext/simplexml/simplexml.c
ext/spl/spl_fixedarray.c
#ifdef VIRTUAL_DIR
virtual_filepath_ex(path, &path_copy, NULL TSRMLS_CC);
#else
- path_copy = estrdup(path);
+ path_copy = path;
-#endif
+#endif
if (php_check_open_basedir(path_copy TSRMLS_CC)) {
+ #ifdef VIRTUAL_DIR
+ efree(path_copy);
+ #endif
return NULL;
}
bz_file = BZ2_bzopen(path_copy, mode);
if (opened_path && bz_file) {
- *opened_path = estrdup(path_copy);
++#ifdef VIRTUAL_DIR
++ *opened_path = path_copy;
+ path_copy = NULL;
++#else
+ *opened_path = estrdup(path_copy);
++#endif
}
- efree(path_copy);
+
+ #ifdef VIRTUAL_DIR
+ if (path_copy) {
+ efree(path_copy);
+ }
+ #endif
+ path_copy = NULL;
if (bz_file == NULL) {
/* that didn't work, so try and get something from the network/wrapper */
{
double affine[6];
long type;
- zval *options;
+ zval *options = NULL;
- zval **tmp;
+ zval *tmp;
int res = GD_FALSE, i;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|z", &type, &options) == FAILURE) {
case GD_AFFINE_SHEAR_VERTICAL: {
double angle;
- convert_to_double_ex(&options);
+ if (!options) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number is expected as option");
+ RETURN_FALSE;
+ }
+ convert_to_double_ex(options);
angle = Z_DVAL_P(options);
if (type == GD_AFFINE_SHEAR_HORIZONTAL) {
/* {{{ _php_mb_regex_globals_ctor */
static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals TSRMLS_DC)
{
- pglobals->default_mbctype = ONIG_ENCODING_EUC_JP;
- pglobals->current_mbctype = ONIG_ENCODING_EUC_JP;
+ pglobals->default_mbctype = ONIG_ENCODING_UTF8;
+ pglobals->current_mbctype = ONIG_ENCODING_UTF8;
- zend_hash_init(&(pglobals->ht_rc), 0, NULL, (void (*)(void *)) php_mb_regex_free_cache, 1);
- pglobals->search_str = (zval*) NULL;
+ zend_hash_init(&(pglobals->ht_rc), 0, NULL, php_mb_regex_free_cache, 1);
+ ZVAL_UNDEF(&pglobals->search_str);
pglobals->search_re = (php_mb_regex_t*)NULL;
pglobals->search_pos = 0;
pglobals->search_regs = (OnigRegion*)NULL;
}
close_fp = 0;
- opened = (char *) estrndup(str, sizeof("[stream]") + 1);
+ opened = (char *) estrndup(str, sizeof("[stream]") - 1);
goto after_open_fp;
case IS_OBJECT:
- if (instanceof_function(Z_OBJCE_PP(value), spl_ce_SplFileInfo TSRMLS_CC)) {
+ if (instanceof_function(Z_OBJCE_P(value), spl_ce_SplFileInfo TSRMLS_CC)) {
char *test = NULL;
zval dummy;
- spl_filesystem_object *intern = (spl_filesystem_object*)zend_object_store_get_object(*value TSRMLS_CC);
+ spl_filesystem_object *intern = (spl_filesystem_object*)((char*)Z_OBJ_P(value) - Z_OBJ_P(value)->handlers->offset);
if (!base_len) {
- zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returns an SplFileInfo object, so base directory must be specified", ce->name);
+ zend_throw_exception_ex(spl_ce_BadMethodCallException, 0 TSRMLS_CC, "Iterator %v returns an SplFileInfo object, so base directory must be specified", ce->name->val);
return ZEND_HASH_APPLY_STOP;
}
}
}
- /* Finally check session id for dangarous characters
+ /* Finally check session id for dangerous characters
* Security note: session id may be embedded in HTML pages.*/
- if (PS(id) && strpbrk(PS(id), "\r\n\t <>'\"\\")) {
- efree(PS(id));
+ if (PS(id) && strpbrk(PS(id)->val, "\r\n\t <>'\"\\")) {
+ STR_RELEASE(PS(id));
PS(id) = NULL;
}
return;
}
- array_init(return_value);
-
- sxe = php_sxe_fetch_object(getThis() TSRMLS_CC);
+ sxe = Z_SXEOBJ_P(getThis());
if(from_root){
node = xmlDocGetRootElement((xmlDocPtr)sxe->document->ptr);
}else{
array->elements = NULL;
}
} else if (size > array->size) {
- array->elements = erealloc(array->elements, sizeof(zval) * size);
- array->elements = safe_erealloc(array->elements, size, sizeof(zval *), 0);
- memset(array->elements + array->size, '\0', sizeof(zval *) * (size - array->size));
++ array->elements = safe_erealloc(array->elements, size, sizeof(zval), 0);
+ memset(array->elements + array->size, '\0', sizeof(zval) * (size - array->size));
} else { /* size < array->size */
long i;
typedef unsigned __int64 php_timeout_ull;
#endif
-#define GET_CTX_OPT(stream, wrapper, name, val) (stream->context && SUCCESS == php_stream_context_get_option(stream->context, wrapper, name, &val))
++#define GET_CTX_OPT(stream, wrapper, name, val) (stream->context && NULL != (val = php_stream_context_get_option(stream->context, wrapper, name)))
+
static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC);
/* Streams based network functions */
RETURN_FALSE;
}
- php_stream_from_zval(stream, &zstream);
+ php_stream_from_zval(stream, zstream);
- if (ZEND_NUM_ARGS() >= 3) {
+ if (enable) {
+ if (ZEND_NUM_ARGS() < 3 || cryptokindnull) {
- zval **val;
++ zval *val;
+
+ if (!GET_CTX_OPT(stream, "ssl", "crypto_method", val)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "When enabling encryption you must specify the crypto type");
+ RETURN_FALSE;
+ }
+
- cryptokind = Z_LVAL_PP(val);
++ cryptokind = Z_LVAL_P(val);
+ }
+
if (zsessstream) {
- php_stream_from_zval(sessstream, &zsessstream);
+ php_stream_from_zval(sessstream, zsessstream);
}
if (php_stream_xport_crypto_setup(stream, cryptokind, sessstream TSRMLS_CC) < 0) {