summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/bcmath/bcmath.c32
-rw-r--r--ext/bz2/bz2.c44
-rw-r--r--ext/bz2/bz2_filter.c4
-rw-r--r--ext/com_dotnet/com_com.c77
-rw-r--r--ext/com_dotnet/com_extension.c6
-rw-r--r--ext/com_dotnet/com_handlers.c4
-rw-r--r--ext/com_dotnet/com_misc.c4
-rw-r--r--ext/com_dotnet/com_olechar.c2
-rw-r--r--ext/com_dotnet/com_persist.c10
-rw-r--r--ext/com_dotnet/com_saproxy.c10
-rw-r--r--ext/com_dotnet/com_typeinfo.c8
-rw-r--r--ext/com_dotnet/com_variant.c54
-rw-r--r--ext/com_dotnet/com_wrapper.c4
-rw-r--r--ext/com_dotnet/php_com_dotnet_internal.h5
-rw-r--r--ext/com_dotnet/tests/bug33386.phpt4
-rw-r--r--ext/com_dotnet/tests/variants.phpt3
-rw-r--r--ext/com_dotnet/tests/variants_x64.phpt638
-rw-r--r--ext/ctype/ctype.c4
-rw-r--r--ext/curl/tests/bug68089.phpt2
-rw-r--r--ext/date/lib/parse_date.c6
-rw-r--r--ext/date/lib/parse_date.re4
-rw-r--r--ext/date/lib/parse_iso_intervals.c4
-rw-r--r--ext/date/lib/parse_iso_intervals.re2
-rw-r--r--ext/date/lib/timelib.h6
-rw-r--r--ext/date/lib/timezonedb.h1483
-rw-r--r--ext/date/php_date.c10
-rw-r--r--ext/date/php_date.h2
-rw-r--r--ext/fileinfo/libmagic.patch767
-rw-r--r--ext/fileinfo/libmagic/readelf.c7
-rw-r--r--ext/filter/logical_filters.c33
-rw-r--r--ext/filter/sanitizing_filters.c4
-rw-r--r--ext/gd/config.w323
-rw-r--r--ext/gmp/gmp.c26
-rw-r--r--ext/iconv/iconv.c8
-rw-r--r--ext/mcrypt/mcrypt.c28
-rw-r--r--ext/mcrypt/mcrypt_filter.c10
-rw-r--r--ext/mysqlnd/mysqlnd.c4
-rw-r--r--ext/opcache/Optimizer/optimize_func_calls.c2
-rw-r--r--ext/opcache/Optimizer/pass1_5.c209
-rw-r--r--ext/opcache/Optimizer/zend_optimizer.c8
-rw-r--r--ext/opcache/ZendAccelerator.c17
-rw-r--r--ext/opcache/ZendAccelerator.h1
-rw-r--r--ext/opcache/tests/bug68104.phpt19
-rw-r--r--ext/opcache/tests/bug68252.phpt20
-rw-r--r--ext/opcache/zend_accelerator_module.c2
-rw-r--r--ext/pcre/php_pcre.c62
-rw-r--r--ext/pcre/php_pcre.h10
-rw-r--r--ext/pdo/pdo_stmt.c23
-rw-r--r--ext/pdo_dblib/README31
-rw-r--r--ext/pdo_dblib/dblib_driver.c69
-rw-r--r--ext/pdo_pgsql/pgsql_driver.c28
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c11
-rw-r--r--ext/pdo_pgsql/tests/bug62593.phpt15
-rw-r--r--ext/pdo_pgsql/tests/bug66584.phpt66
-rw-r--r--ext/pdo_pgsql/tests/bug67462.phpt34
-rw-r--r--ext/pgsql/pgsql.c133
-rw-r--r--ext/pgsql/tests/80_bug36625.phpt8
-rw-r--r--ext/pgsql/tests/config.inc10
-rw-r--r--ext/reflection/php_reflection.c44
-rw-r--r--ext/session/session.c24
-rw-r--r--ext/session/tests/session_set_save_handler_iface_003.phpt3
-rw-r--r--ext/session/tests/session_set_save_handler_sid_001.phpt3
-rw-r--r--ext/session/tests/session_set_save_handler_write_short_circuit.phpt1
-rw-r--r--ext/soap/soap.c3
-rw-r--r--ext/soap/tests/bug68361.phpt114
-rw-r--r--ext/sockets/tests/mcast_ipv4_send.phpt131
-rw-r--r--ext/spl/php_spl.c8
-rw-r--r--ext/spl/spl_directory.c28
-rw-r--r--ext/spl/spl_dllist.c2
-rw-r--r--ext/spl/spl_fixedarray.c6
-rw-r--r--ext/spl/spl_heap.c12
-rw-r--r--ext/spl/spl_iterators.c15
-rw-r--r--ext/spl/spl_iterators.h2
-rw-r--r--ext/spl/spl_observer.c2
-rw-r--r--ext/standard/basic_functions.c4
-rw-r--r--ext/standard/basic_functions.h8
-rw-r--r--ext/standard/exec.c4
-rw-r--r--ext/standard/file.c122
-rw-r--r--ext/standard/ftp_fopen_wrapper.c7
-rw-r--r--ext/standard/incomplete_class.c2
-rw-r--r--ext/standard/password.c22
-rw-r--r--ext/standard/php_fopen_wrapper.c2
-rw-r--r--ext/standard/php_fopen_wrappers.h4
-rw-r--r--ext/standard/php_incomplete_class.h2
-rw-r--r--ext/standard/tests/file/bug52820.phpt134
-rw-r--r--ext/standard/url_scanner_ex.c19
-rw-r--r--ext/standard/url_scanner_ex.h2
-rw-r--r--ext/standard/url_scanner_ex.re19
-rw-r--r--ext/standard/user_filters.c4
-rw-r--r--ext/wddx/php_wddx_api.h2
-rw-r--r--ext/wddx/wddx.c5
-rw-r--r--ext/xmlrpc/libxmlrpc/xmlrpc.c6
-rw-r--r--ext/zlib/zlib.c12
93 files changed, 3128 insertions, 1750 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c
index 4f8938a108..11f30e47c3 100644
--- a/ext/bcmath/bcmath.c
+++ b/ext/bcmath/bcmath.c
@@ -215,14 +215,14 @@ PHP_FUNCTION(bcadd)
zend_long scale_param = 0;
bc_num first, second, result;
size_t left_len, right_len;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) (scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
@@ -252,14 +252,14 @@ PHP_FUNCTION(bcsub)
size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
@@ -289,14 +289,14 @@ PHP_FUNCTION(bcmul)
size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
@@ -326,14 +326,14 @@ PHP_FUNCTION(bcdiv)
size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
@@ -417,11 +417,11 @@ PHP_FUNCTION(bcpowmod)
php_str2num(&second, right TSRMLS_CC);
php_str2num(&mod, modulous TSRMLS_CC);
- scale_int = (int) ((int)scale < 0) ? 0 : scale;
+ scale_int = (int) ((int)scale < 0 ? 0 : scale);
if (bc_raisemod(first, second, mod, &result, scale_int TSRMLS_CC) != -1) {
if (result->n_scale > scale) {
- result->n_scale = scale;
+ result->n_scale = (int)scale;
}
RETVAL_STR(bc_num2str(result));
} else {
@@ -444,14 +444,14 @@ PHP_FUNCTION(bcpow)
size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second, result;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
@@ -481,14 +481,14 @@ PHP_FUNCTION(bcsqrt)
size_t left_len;
zend_long scale_param = 0;
bc_num result;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "s|l", &left, &left_len, &scale_param) == FAILURE) {
return;
}
if (argc == 2) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&result TSRMLS_CC);
@@ -516,14 +516,14 @@ PHP_FUNCTION(bccomp)
size_t left_len, right_len;
zend_long scale_param = 0;
bc_num first, second;
- int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
+ int scale = (int)BCG(bc_precision), argc = ZEND_NUM_ARGS();
if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
return;
}
if (argc == 3) {
- scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
+ scale = (int) ((int)scale_param < 0 ? 0 : scale_param);
}
bc_init_num(&first TSRMLS_CC);
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c
index 6e6f2a95c3..d49be40d35 100644
--- a/ext/bz2/bz2.c
+++ b/ext/bz2/bz2.c
@@ -138,22 +138,48 @@ struct php_bz2_stream_data_t {
static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
{
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
- size_t ret;
+ size_t ret = 0;
- ret = BZ2_bzread(self->bz_file, buf, count);
+ do {
+ int just_read;
+ size_t remain = count - ret;
+ int to_read = (int)(remain <= INT_MAX ? remain : INT_MAX);
- if (ret == 0) {
- stream->eof = 1;
- }
+ just_read = BZ2_bzread(self->bz_file, buf, to_read);
+
+ if (just_read < 1) {
+ stream->eof = 0 == just_read;
+ break;
+ }
+
+ ret += just_read;
+ } while (ret < count);
return ret;
}
static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC)
{
+ size_t wrote = 0;
struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract;
- return BZ2_bzwrite(self->bz_file, (char*)buf, count);
+
+ do {
+ int just_wrote;
+ size_t remain = count - wrote;
+ int to_write = (int)(remain <= INT_MAX ? remain : INT_MAX);
+
+ just_wrote = BZ2_bzwrite(self->bz_file, (char*)buf, to_write);
+
+ if (just_wrote < 1) {
+ break;
+ }
+
+ wrote += just_wrote;
+
+ } while (wrote < count);
+
+ return wrote;
}
static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC)
@@ -262,7 +288,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper,
if (stream) {
php_socket_t fd;
if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) {
- bz_file = BZ2_bzdopen(fd, mode);
+ bz_file = BZ2_bzdopen((int)fd, mode);
}
}
@@ -439,7 +465,7 @@ static PHP_FUNCTION(bzopen)
RETURN_FALSE;
}
- bz = BZ2_bzdopen(fd, mode);
+ bz = BZ2_bzdopen((int)fd, mode);
stream = php_stream_bz2open_from_BZFILE(bz, mode, stream);
} else {
@@ -554,7 +580,7 @@ static PHP_FUNCTION(bzdecompress)
bzs.bzalloc = NULL;
bzs.bzfree = NULL;
- if (BZ2_bzDecompressInit(&bzs, 0, small) != BZ_OK) {
+ if (BZ2_bzDecompressInit(&bzs, 0, (int)small) != BZ_OK) {
RETURN_FALSE;
}
diff --git a/ext/bz2/bz2_filter.c b/ext/bz2/bz2_filter.c
index 1c1d6ccfb6..a2a21d765b 100644
--- a/ext/bz2/bz2_filter.c
+++ b/ext/bz2/bz2_filter.c
@@ -384,7 +384,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
if (Z_LVAL(tmp) < 1 || Z_LVAL(tmp) > 9) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for number of blocks to allocate. (%pd)", Z_LVAL_P(tmpzval));
} else {
- blockSize100k = Z_LVAL(tmp);
+ blockSize100k = (int)Z_LVAL(tmp);
}
}
@@ -398,7 +398,7 @@ static php_stream_filter *php_bz2_filter_create(const char *filtername, zval *fi
if (Z_LVAL(tmp) < 0 || Z_LVAL(tmp) > 250) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid parameter given for work factor. (%pd)", Z_LVAL(tmp));
} else {
- workFactor = Z_LVAL(tmp);
+ workFactor = (int)Z_LVAL(tmp);
}
}
}
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c
index 5f0b8ff697..7de6d949bb 100644
--- a/ext/com_dotnet/com_com.c
+++ b/ext/com_dotnet/com_com.c
@@ -37,7 +37,7 @@ PHP_FUNCTION(com_create_instance)
php_com_dotnet_object *obj;
char *module_name, *typelib_name = NULL, *server_name = NULL;
char *user_name = NULL, *domain_name = NULL, *password = NULL;
- size_t module_name_len, typelib_name_len, server_name_len,
+ size_t module_name_len = 0, typelib_name_len = 0, server_name_len = 0,
user_name_len, domain_name_len, password_len;
OLECHAR *moniker;
CLSID clsid;
@@ -129,11 +129,11 @@ PHP_FUNCTION(com_create_instance)
if (user_name) {
authid.User = php_com_string_to_olestring(user_name, -1, obj->code_page TSRMLS_CC);
- authid.UserLength = user_name_len;
+ authid.UserLength = (ULONG)user_name_len;
if (password) {
authid.Password = (OLECHAR*)password;
- authid.PasswordLength = password_len;
+ authid.PasswordLength = (ULONG)password_len;
} else {
authid.Password = (OLECHAR*)"";
authid.PasswordLength = 0;
@@ -141,7 +141,7 @@ PHP_FUNCTION(com_create_instance)
if (domain_name) {
authid.Domain = (OLECHAR*)domain_name;
- authid.DomainLength = domain_name_len;
+ authid.DomainLength = (ULONG)domain_name_len;
} else {
authid.Domain = (OLECHAR*)"";
authid.DomainLength = 0;
@@ -254,7 +254,7 @@ PHP_FUNCTION(com_create_instance)
ITypeLib_Release(TL);
}
} else if (obj->typeinfo && COMG(autoreg_on)) {
- int idx;
+ UINT idx;
if (SUCCEEDED(ITypeInfo_GetContainingTypeLib(obj->typeinfo, &TL, &idx))) {
/* check if the library is already in the cache by getting its name */
@@ -288,7 +288,7 @@ PHP_FUNCTION(com_get_active_object)
{
CLSID clsid;
char *module_name;
- int module_name_len;
+ size_t module_name_len;
zend_long code_page = COMG(code_page);
IUnknown *unk = NULL;
IDispatch *obj = NULL;
@@ -302,7 +302,7 @@ PHP_FUNCTION(com_get_active_object)
return;
}
- module = php_com_string_to_olestring(module_name, module_name_len, code_page TSRMLS_CC);
+ module = php_com_string_to_olestring(module_name, module_name_len, (int)code_page TSRMLS_CC);
res = CLSIDFromString(module, &clsid);
@@ -320,7 +320,7 @@ PHP_FUNCTION(com_get_active_object)
php_com_throw_exception(res, NULL TSRMLS_CC);
} else if (obj) {
/* we got our dispatchable object */
- php_com_wrap_dispatch(return_value, obj, code_page TSRMLS_CC);
+ php_com_wrap_dispatch(return_value, obj, (int)code_page TSRMLS_CC);
}
}
}
@@ -427,7 +427,7 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
}
if (obj->id_of_name_cache && NULL != (tmp = zend_hash_str_find(obj->id_of_name_cache, name, namelen))) {
- *dispid = Z_LVAL_P(tmp);
+ *dispid = (DISPID)Z_LVAL_P(tmp);
return S_OK;
}
@@ -474,8 +474,8 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
int i, byref_count = 0, j;
/* assumption: that the active function (f) is the function we generated for the engine */
- if (!f || f->arg_info == NULL) {
- f = NULL;
+ if (!f) {
+ return FAILURE;
}
hr = php_com_get_id_of_name(obj, f->function_name->val, f->function_name->len, &dispid TSRMLS_CC);
@@ -496,7 +496,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
vargs = (VARIANT*)safe_emalloc(sizeof(VARIANT), nargs, 0);
}
- if (f) {
+ if (f->arg_info) {
for (i = 0; i < nargs; i++) {
if (f->arg_info[nargs - i - 1].pass_by_reference) {
byref_count++;
@@ -551,30 +551,36 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *
/* release variants */
if (vargs) {
- for (i = 0, j = 0; i < nargs; i++) {
- /* if this was byref, update the zval */
- if (f && f->arg_info[nargs - i - 1].pass_by_reference) {
- SEPARATE_ZVAL_IF_NOT_REF(&args[nargs - i - 1]);
-
- /* if the variant is pointing at the byref_vals, we need to map
- * the pointee value as a zval; otherwise, the value is pointing
- * into an existing PHP variant record */
- if (V_VT(&vargs[i]) & VT_BYREF) {
- if (vargs[i].byref == &V_UINT(&byref_vals[j])) {
- /* copy that value */
- php_com_zval_from_variant(&args[nargs - i - 1], &byref_vals[j],
+ if (f && f->arg_info) {
+ for (i = 0, j = 0; i < nargs; i++) {
+ /* if this was byref, update the zval */
+ if (f->arg_info[nargs - i - 1].pass_by_reference) {
+ SEPARATE_ZVAL_IF_NOT_REF(&args[nargs - i - 1]);
+
+ /* if the variant is pointing at the byref_vals, we need to map
+ * the pointee value as a zval; otherwise, the value is pointing
+ * into an existing PHP variant record */
+ if (V_VT(&vargs[i]) & VT_BYREF) {
+ if (vargs[i].byref == &V_UINT(&byref_vals[j])) {
+ /* copy that value */
+ php_com_zval_from_variant(&args[nargs - i - 1], &byref_vals[j],
+ obj->code_page TSRMLS_CC);
+ }
+ } else {
+ /* not sure if this can ever happen; the variant we marked as BYREF
+ * is no longer BYREF - copy its value */
+ php_com_zval_from_variant(&args[nargs - i - 1], &vargs[i],
obj->code_page TSRMLS_CC);
}
- } else {
- /* not sure if this can ever happen; the variant we marked as BYREF
- * is no longer BYREF - copy its value */
- php_com_zval_from_variant(&args[nargs - i - 1], &vargs[i],
- obj->code_page TSRMLS_CC);
+ VariantClear(&byref_vals[j]);
+ j++;
}
- VariantClear(&byref_vals[j]);
- j++;
- }
- VariantClear(&vargs[i]);
+ VariantClear(&vargs[i]);
+ }
+ } else {
+ for (i = 0, j = 0; i < nargs; i++) {
+ VariantClear(&vargs[i]);
+ }
}
efree(vargs);
}
@@ -631,7 +637,7 @@ int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
return SUCCEEDED(hr) ? SUCCESS : FAILURE;
}
-int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen,
+int php_com_do_invoke(php_com_dotnet_object *obj, char *name, size_t namelen,
WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg TSRMLS_DC)
{
DISPID dispid;
@@ -687,7 +693,6 @@ PHP_FUNCTION(com_event_sink)
{
zval *object, *sinkobject, *sink=NULL;
char *dispname = NULL, *typelibname = NULL;
- zend_bool gotguid = 0;
php_com_dotnet_object *obj;
ITypeInfo *typeinfo = NULL;
@@ -791,7 +796,7 @@ PHP_FUNCTION(com_message_pump)
RETURN_FALSE;
php_com_initialize(TSRMLS_C);
- result = MsgWaitForMultipleObjects(0, NULL, FALSE, timeoutms, QS_ALLINPUT);
+ result = MsgWaitForMultipleObjects(0, NULL, FALSE, (DWORD)timeoutms, QS_ALLINPUT);
if (result == WAIT_OBJECT_0) {
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c
index ce1fa744dd..35fda89963 100644
--- a/ext/com_dotnet/com_extension.c
+++ b/ext/com_dotnet/com_extension.c
@@ -393,7 +393,7 @@ PHP_MINIT_FUNCTION(com_dotnet)
#define COM_ERR_CONST(x) { \
zend_long __tmp; \
- ULongToUIntPtr(x, &__tmp); \
+ ULongToIntPtr(x, &__tmp); \
REGISTER_LONG_CONSTANT(#x, __tmp, CONST_CS|CONST_PERSISTENT); \
}
@@ -460,6 +460,10 @@ PHP_MINIT_FUNCTION(com_dotnet)
COM_ERR_CONST(DISP_E_BADINDEX);
COM_ERR_CONST(MK_E_UNAVAILABLE);
+#if SIZEOF_ZEND_LONG == 8
+ COM_CONST(VT_UI8);
+ COM_CONST(VT_I8);
+#endif
return SUCCESS;
}
/* }}} */
diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c
index 6f63a1fbd8..8b721393fd 100644
--- a/ext/com_dotnet/com_handlers.c
+++ b/ext/com_dotnet/com_handlers.c
@@ -101,7 +101,7 @@ static zval *com_read_dimension(zval *object, zval *offset, int type, zval *rv T
convert_to_long(offset);
if (SafeArrayGetDim(V_ARRAY(&obj->v)) == 1) {
- if (php_com_safearray_get_elem(&obj->v, &v, Z_LVAL_P(offset) TSRMLS_CC)) {
+ if (php_com_safearray_get_elem(&obj->v, &v, (LONG)Z_LVAL_P(offset) TSRMLS_CC)) {
php_com_wrap_variant(rv, &v, obj->code_page TSRMLS_CC);
VariantClear(&v);
}
@@ -145,7 +145,7 @@ static void com_write_dimension(zval *object, zval *offset, zval *value TSRMLS_D
}
convert_to_long(offset);
- indices = Z_LVAL_P(offset);
+ indices = (LONG)Z_LVAL_P(offset);
VariantInit(&v);
php_com_variant_from_zval(&v, value, obj->code_page TSRMLS_CC);
diff --git a/ext/com_dotnet/com_misc.c b/ext/com_dotnet/com_misc.c
index 084a720ea1..f0b21ff014 100644
--- a/ext/com_dotnet/com_misc.c
+++ b/ext/com_dotnet/com_misc.c
@@ -36,7 +36,11 @@ void php_com_throw_exception(HRESULT code, char *message TSRMLS_DC)
message = php_win32_error_to_msg(code);
free_msg = 1;
}
+#if SIZEOF_ZEND_LONG == 8
+ zend_throw_exception(php_com_exception_class_entry, message, (zend_long)(uint32_t)code TSRMLS_CC);
+#else
zend_throw_exception(php_com_exception_class_entry, message, (zend_long)code TSRMLS_CC);
+#endif
if (free_msg) {
LocalFree(message);
}
diff --git a/ext/com_dotnet/com_olechar.c b/ext/com_dotnet/com_olechar.c
index 51cc7e8f1d..2e0b558288 100644
--- a/ext/com_dotnet/com_olechar.c
+++ b/ext/com_dotnet/com_olechar.c
@@ -49,7 +49,7 @@ PHP_COM_DOTNET_API OLECHAR *php_com_string_to_olestring(char *string, size_t str
/* XXX if that's a real multibyte string, olestring is obviously allocated excessively.
This should be fixed by reallocating the olestring, but as emalloc is used, that doesn't
matter much. */
- ok = MultiByteToWideChar(codepage, flags, string, string_len, olestring, string_len);
+ ok = MultiByteToWideChar(codepage, flags, string, (int)string_len, olestring, (int)string_len);
if (ok > 0 && ok < string_len) {
olestring[ok] = '\0';
}
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index eb80e760c8..dbe8b45300 100644
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -105,10 +105,10 @@ static ULONG STDMETHODCALLTYPE stm_release(IStream *This)
static HRESULT STDMETHODCALLTYPE stm_read(IStream *This, void *pv, ULONG cb, ULONG *pcbRead)
{
- int nread;
+ ULONG nread;
FETCH_STM();
- nread = php_stream_read(stm->stream, pv, cb);
+ nread = (ULONG)php_stream_read(stm->stream, pv, cb);
if (pcbRead) {
*pcbRead = nread > 0 ? nread : 0;
@@ -121,10 +121,10 @@ static HRESULT STDMETHODCALLTYPE stm_read(IStream *This, void *pv, ULONG cb, ULO
static HRESULT STDMETHODCALLTYPE stm_write(IStream *This, void const *pv, ULONG cb, ULONG *pcbWritten)
{
- int nwrote;
+ ULONG nwrote;
FETCH_STM();
- nwrote = php_stream_write(stm->stream, pv, cb);
+ nwrote = (ULONG)php_stream_write(stm->stream, pv, cb);
if (pcbWritten) {
*pcbWritten = nwrote > 0 ? nwrote : 0;
@@ -466,7 +466,7 @@ CPH_METHOD(LoadFromFile)
olefilename = php_com_string_to_olestring(fullpath, strlen(fullpath), helper->codepage TSRMLS_CC);
efree(fullpath);
- res = IPersistFile_Load(helper->ipf, olefilename, flags);
+ res = IPersistFile_Load(helper->ipf, olefilename, (DWORD)flags);
efree(olefilename);
if (FAILED(res)) {
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index ddee9bc179..1d187a77bf 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -167,11 +167,11 @@ static zval *saproxy_read_dimension(zval *object, zval *offset, int type, zval *
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
convert_to_long(&proxy->indices[i]);
- indices[i] = Z_LVAL(proxy->indices[i]);
+ indices[i] = (LONG)Z_LVAL(proxy->indices[i]);
}
/* add user-supplied index */
- indices[dims-1] = Z_LVAL_P(offset);
+ indices[dims-1] = (LONG)Z_LVAL_P(offset);
/* now fetch the value */
if (FAILED(SafeArrayGetVartype(sa, &vt)) || vt == VT_EMPTY) {
@@ -241,12 +241,12 @@ static void saproxy_write_dimension(zval *object, zval *offset, zval *value TSRM
/* copy indices from proxy */
for (i = 0; i < dims; i++) {
convert_to_long(&proxy->indices[i]);
- indices[i] = Z_LVAL(proxy->indices[i]);
+ indices[i] = (LONG)Z_LVAL(proxy->indices[i]);
}
/* add user-supplied index */
convert_to_long(offset);
- indices[dims-1] = Z_LVAL_P(offset);
+ indices[dims-1] = (LONG)Z_LVAL_P(offset);
if (FAILED(SafeArrayGetVartype(V_ARRAY(&proxy->obj->v), &vt)) || vt == VT_EMPTY) {
vt = V_VT(&proxy->obj->v) & ~VT_ARRAY;
@@ -555,7 +555,7 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec
I->indices = safe_emalloc(proxy->dimensions + 1, sizeof(LONG), 0);
for (i = 0; i < proxy->dimensions; i++) {
convert_to_long(&proxy->indices[i]);
- I->indices[i] = Z_LVAL(proxy->indices[i]);
+ I->indices[i] = (LONG)Z_LVAL(proxy->indices[i]);
}
SafeArrayGetLBound(V_ARRAY(&proxy->obj->v), proxy->dimensions, &I->imin);
diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c
index 33b1c65c9c..ac5777cef1 100644
--- a/ext/com_dotnet/com_typeinfo.c
+++ b/ext/com_dotnet/com_typeinfo.c
@@ -71,7 +71,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
if (FAILED(hr) && (major == NULL || minor == NULL)) {
IDispatch *disp = NULL;
ITypeInfo *info = NULL;
- int idx;
+ UINT idx;
if (SUCCEEDED(hr = CoCreateInstance(&clsid, NULL, CLSCTX_SERVER, &IID_IDispatch, (LPVOID*)&disp)) &&
SUCCEEDED(hr = IDispatch_GetTypeInfo(disp, 0, LANG_NEUTRAL, &info))) {
@@ -96,7 +96,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
DWORD VersionCount;
char version[20];
char *libname;
- DWORD libnamelen;
+ long libnamelen;
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, "TypeLib", 0, KEY_READ, &hkey) &&
ERROR_SUCCESS == RegQueryInfoKey(hkey, NULL, NULL, NULL, &SubKeys,
@@ -116,7 +116,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib(char *search_string, int codep
continue;
}
/* get the default value for this key and compare */
- libnamelen = strlen(search_string)+1;
+ libnamelen = (long)strlen(search_string)+1;
if (ERROR_SUCCESS == RegQueryValue(hsubkey, version, libname, &libnamelen)) {
if (0 == stricmp(libname, search_string)) {
char *str = NULL;
@@ -234,7 +234,7 @@ PHP_COM_DOTNET_API ITypeLib *php_com_load_typelib_via_cache(char *search_string,
{
ITypeLib *TL;
char *name_dup;
- int l;
+ size_t l;
l = strlen(search_string);
diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c
index dbd5529f6d..7317b8d0e4 100644
--- a/ext/com_dotnet/com_variant.c
+++ b/ext/com_dotnet/com_variant.c
@@ -39,8 +39,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
HashPosition pos;
int keytype;
zend_string *strindex;
- zend_long intindex = -1;
- zend_long max_index = 0;
+ zend_ulong intindex = 0;
VARIANT *va;
zval *item;
@@ -54,15 +53,15 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC)
goto bogus;
} else if (HASH_KEY_NON_EXISTENT == keytype) {
break;
- }
- if (intindex > max_index) {
- max_index = intindex;
+ } else if (intindex > UINT_MAX) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "COM: max number %u of elements in safe array exceeded", UINT_MAX);
+ break;
}
}
/* allocate the structure */
bound.lLbound = 0;
- bound.cElements = intindex + 1;
+ bound.cElements = zend_hash_num_elements(HASH_OF(z));
sa = SafeArrayCreate(VT_VARIANT, 1, &bound);
/* get a lock on the array itself */
@@ -146,8 +145,13 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
break;
case IS_LONG:
+#if SIZEOF_ZEND_LONG == 4
V_VT(v) = VT_I4;
V_I4(v) = Z_LVAL_P(z);
+#else
+ V_VT(v) = VT_I8;
+ V_I8(v) = Z_LVAL_P(z);
+#endif
break;
case IS_DOUBLE:
@@ -159,9 +163,9 @@ PHP_COM_DOTNET_API void php_com_variant_from_zval(VARIANT *v, zval *z, int codep
V_VT(v) = VT_BSTR;
olestring = php_com_string_to_olestring(Z_STRVAL_P(z), Z_STRLEN_P(z), codepage TSRMLS_CC);
if (CP_UTF8 == codepage) {
- V_BSTR(v) = SysAllocStringByteLen((char*)olestring, wcslen(olestring) * sizeof(OLECHAR));
+ V_BSTR(v) = SysAllocStringByteLen((char*)olestring, (UINT)(wcslen(olestring) * sizeof(OLECHAR)));
} else {
- V_BSTR(v) = SysAllocStringByteLen((char*)olestring, Z_STRLEN_P(z) * sizeof(OLECHAR));
+ V_BSTR(v) = SysAllocStringByteLen((char*)olestring, (UINT)(Z_STRLEN_P(z) * sizeof(OLECHAR)));
}
efree(olestring);
break;
@@ -199,11 +203,19 @@ PHP_COM_DOTNET_API int php_com_zval_from_variant(zval *z, VARIANT *v, int codepa
ZVAL_LONG(z, (zend_long)V_I2(v));
break;
case VT_UI4: /* TODO: promote to double if large? */
- ZVAL_LONG(z, (zend_long)V_UI4(v));
+ ZVAL_LONG(z, (long)V_UI4(v));
break;
case VT_I4:
- ZVAL_LONG(z, (zend_long)V_I4(v));
+ ZVAL_LONG(z, (long)V_I4(v));
+ break;
+#if SIZEOF_ZEND_LONG == 8
+ case VT_UI8:
+ ZVAL_LONG(z, (zend_long)V_UI8(v));
break;
+ case VT_I8:
+ ZVAL_LONG(z, (zend_long)V_I8(v));
+ break;
+#endif
case VT_INT:
ZVAL_LONG(z, V_INT(v));
break;
@@ -328,7 +340,23 @@ PHP_COM_DOTNET_API int php_com_copy_variant(VARIANT *dstvar, VARIANT *srcvar TSR
V_I4(dstvar) = V_I4(srcvar);
}
break;
+#if SIZEOF_ZEND_LONG == 8
+ case VT_UI8:
+ if (V_VT(dstvar) & VT_BYREF) {
+ *V_UI8REF(dstvar) = V_UI8(srcvar);
+ } else {
+ V_UI8(dstvar) = V_UI8(srcvar);
+ }
+ break;
+ case VT_I8:
+ if (V_VT(dstvar) & VT_BYREF) {
+ *V_I8REF(dstvar) = V_I8(srcvar);
+ } else {
+ V_I8(dstvar) = V_I8(srcvar);
+ }
+ break;
+#endif
case VT_INT:
if (V_VT(dstvar) & VT_BYREF) {
*V_INTREF(dstvar) = V_INT(srcvar);
@@ -428,7 +456,7 @@ PHP_FUNCTION(com_variant_create_instance)
php_com_initialize(TSRMLS_C);
if (ZEND_NUM_ARGS() == 3) {
- obj->code_page = codepage;
+ obj->code_page = (int)codepage;
}
if (zvalue) {
@@ -849,7 +877,7 @@ PHP_FUNCTION(variant_round)
return;
}
- if (SUCCEEDED(VarRound(vleft, decimals, &vres))) {
+ if (SUCCEEDED(VarRound(vleft, (int)decimals, &vres))) {
php_com_wrap_variant(return_value, &vres, codepage TSRMLS_CC);
}
@@ -909,7 +937,7 @@ PHP_FUNCTION(variant_cmp)
return;
}
- ZVAL_LONG(return_value, VarCmp(vleft, vright, lcid, flags));
+ ZVAL_LONG(return_value, VarCmp(vleft, vright, (LCID)lcid, (ULONG)flags));
VariantClear(&left_val);
VariantClear(&right_val);
diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c
index 6112dfb4bf..f7dd7fd463 100644
--- a/ext/com_dotnet/com_wrapper.c
+++ b/ext/com_dotnet/com_wrapper.c
@@ -186,7 +186,7 @@ static HRESULT STDMETHODCALLTYPE disp_getidsofnames(
ret = DISP_E_UNKNOWNNAME;
rgDispId[i] = 0;
} else {
- rgDispId[i] = Z_LVAL_P(tmp);
+ rgDispId[i] = (DISPID)Z_LVAL_P(tmp);
}
efree(name);
@@ -231,7 +231,7 @@ static HRESULT STDMETHODCALLTYPE disp_getdispid(
/* Lookup the name in the hash */
if ((tmp = zend_hash_str_find(disp->name_to_dispid, name, namelen)) != NULL) {
trace("found it\n");
- *pid = Z_LVAL_P(tmp);
+ *pid = (DISPID)Z_LVAL_P(tmp);
ret = S_OK;
}
diff --git a/ext/com_dotnet/php_com_dotnet_internal.h b/ext/com_dotnet/php_com_dotnet_internal.h
index e79e6f586d..e06f50c7d6 100644
--- a/ext/com_dotnet/php_com_dotnet_internal.h
+++ b/ext/com_dotnet/php_com_dotnet_internal.h
@@ -37,8 +37,9 @@ typedef struct _php_com_dotnet_object {
VARIANT v;
int modified;
+ int code_page;
+
ITypeInfo *typeinfo;
- zend_long code_page;
zend_class_entry *ce;
@@ -107,7 +108,7 @@ HRESULT php_com_get_id_of_name(php_com_dotnet_object *obj, char *name,
size_t namelen, DISPID *dispid TSRMLS_DC);
int php_com_do_invoke_by_id(php_com_dotnet_object *obj, DISPID dispid,
WORD flags, VARIANT *v, int nargs, zval *args, int silent, int allow_noarg TSRMLS_DC);
-int php_com_do_invoke(php_com_dotnet_object *obj, char *name, int namelen,
+int php_com_do_invoke(php_com_dotnet_object *obj, char *name, size_t namelen,
WORD flags, VARIANT *v, int nargs, zval *args, int allow_noarg TSRMLS_DC);
int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function *f,
WORD flags, VARIANT *v, int nargs, zval *args TSRMLS_DC);
diff --git a/ext/com_dotnet/tests/bug33386.phpt b/ext/com_dotnet/tests/bug33386.phpt
index e57f1274c1..e7dcd28489 100644
--- a/ext/com_dotnet/tests/bug33386.phpt
+++ b/ext/com_dotnet/tests/bug33386.phpt
@@ -2,7 +2,9 @@
Bug #33386 (ScriptControl only sees last function of class)
--SKIPIF--
<?php
-if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?>
+if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present";
+if (4 != PHP_INT_SIZE) print "skip MSScriptControl isn't available under x64";
+?>
--FILE--
<?php
error_reporting(E_ALL);
diff --git a/ext/com_dotnet/tests/variants.phpt b/ext/com_dotnet/tests/variants.phpt
index 0fd27bee5e..6c50beb738 100644
--- a/ext/com_dotnet/tests/variants.phpt
+++ b/ext/com_dotnet/tests/variants.phpt
@@ -2,7 +2,8 @@
COM: General variant tests
--SKIPIF--
<?php # vim:ft=php
-if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; ?>
+if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present";
+if (4 != PHP_INT_SIZE) print "skip x86 only"; ?>
--FILE--
<?php // $Id$
error_reporting(E_ALL);
diff --git a/ext/com_dotnet/tests/variants_x64.phpt b/ext/com_dotnet/tests/variants_x64.phpt
new file mode 100644
index 0000000000..1c75a9da79
--- /dev/null
+++ b/ext/com_dotnet/tests/variants_x64.phpt
@@ -0,0 +1,638 @@
+--TEST--
+COM: General variant tests
+--SKIPIF--
+<?php # vim:ft=php
+if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present";
+if (8 != PHP_INT_SIZE) print "skip x64 only"; ?>
+--FILE--
+<?php // $Id$
+error_reporting(E_ALL);
+
+$v = new VARIANT();
+if (VT_EMPTY != variant_get_type($v)) {
+ echo "VT_EMPTY: bork\n";
+}
+
+$values = array(VT_I8 => 42, VT_R8 => 3.5, VT_BSTR => "hello", VT_BOOL => false);
+$binary_ops = array('add', 'cat', 'sub', 'mul', 'and', 'div',
+ 'eqv', 'idiv', 'imp', 'mod', 'or', 'pow', 'xor');
+
+foreach ($values as $t => $val) {
+ $v = new VARIANT($val);
+ if ($t != variant_get_type($v)) {
+ printf("Bork: [%d] %d: %s\n", $t, variant_get_type($v), $val);
+ print $v . "\n";
+ }
+ $results = array();
+
+ foreach ($values as $op2) {
+ echo "--\n";
+ foreach ($binary_ops as $op) {
+ try {
+ echo "$op: " . call_user_func('variant_' . $op, $v, $op2) . "\n";
+ } catch (com_exception $e) {
+ echo "$op:\n";
+ echo "\tvariant_$op($v, $op2)\n";
+ echo "\texception " . $e->getMessage();
+ printf("\tcode %08x\n\n", $e->getCode());
+ }
+ }
+ }
+}
+
+echo "OK!";
+?>
+--EXPECT--
+--
+add: 84
+cat: 4242
+sub: 0
+mul: 1764
+and: 42
+div: 1
+eqv: -1
+idiv: 1
+imp: -1
+mod: 0
+or: 42
+pow: 1.50130937545297E+68
+xor: 0
+--
+add: 45.5
+cat: 423.5
+sub: 38.5
+mul: 147
+and: 0
+div: 12
+eqv: -47
+idiv: 10
+imp: -43
+mod: 2
+or: 46
+pow: 480145.116863642
+xor: 46
+--
+add:
+ variant_add(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+cat: 42hello
+sub:
+ variant_sub(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+mul:
+ variant_mul(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+and:
+ variant_and(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+div:
+ variant_div(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+eqv:
+ variant_eqv(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+idiv:
+ variant_idiv(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+imp:
+ variant_imp(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+mod:
+ variant_mod(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+or:
+ variant_or(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+pow:
+ variant_pow(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+xor:
+ variant_xor(42, hello)
+ exception Type mismatch.
+ code 80020005
+
+--
+add: 42
+cat: 42False
+sub: 42
+mul: 0
+and: 0
+div:
+ variant_div(42, )
+ exception Division by zero.
+ code 80020012
+
+eqv: -43
+idiv:
+ variant_idiv(42, )
+ exception Division by zero.
+ code 80020012
+
+imp: -43
+mod:
+ variant_mod(42, )
+ exception Division by zero.
+ code 80020012
+
+or: 42
+pow: 1
+xor: 42
+--
+add: 45.5
+cat: 3.542
+sub: -38.5
+mul: 147
+and: 0
+div: 8.33333333333333E-02
+eqv: -47
+idiv: 0
+imp: -5
+mod: 4
+or: 46
+pow: 7.09345573078604E+22
+xor: 46
+--
+add: 7
+cat: 3.53.5
+sub: 0
+mul: 12.25
+and: 4
+div: 1
+eqv: -1
+idiv: 1
+imp: -1
+mod: 0
+or: 4
+pow: 80.2117802289664
+xor: 0
+--
+add:
+ variant_add(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+cat: 3.5hello
+sub:
+ variant_sub(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+mul:
+ variant_mul(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+and:
+ variant_and(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+div:
+ variant_div(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+eqv:
+ variant_eqv(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+idiv:
+ variant_idiv(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+imp:
+ variant_imp(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+mod:
+ variant_mod(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+or:
+ variant_or(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+pow:
+ variant_pow(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+xor:
+ variant_xor(3.5, hello)
+ exception Type mismatch.
+ code 80020005
+
+--
+add: 3.5
+cat: 3.5False
+sub: 3.5
+mul: 0
+and: 0
+div:
+ variant_div(3.5, )
+ exception Division by zero.
+ code 80020012
+
+eqv: -5
+idiv:
+ variant_idiv(3.5, )
+ exception Division by zero.
+ code 80020012
+
+imp: -5
+mod:
+ variant_mod(3.5, )
+ exception Division by zero.
+ code 80020012
+
+or: 4
+pow: 1
+xor: 4
+--
+add:
+ variant_add(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+cat: hello42
+sub:
+ variant_sub(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+mul:
+ variant_mul(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+and:
+ variant_and(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+div:
+ variant_div(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+eqv:
+ variant_eqv(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+idiv:
+ variant_idiv(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+imp:
+ variant_imp(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+mod:
+ variant_mod(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+or:
+ variant_or(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+pow:
+ variant_pow(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+xor:
+ variant_xor(hello, 42)
+ exception Type mismatch.
+ code 80020005
+
+--
+add:
+ variant_add(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+cat: hello3.5
+sub:
+ variant_sub(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+mul:
+ variant_mul(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+and:
+ variant_and(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+div:
+ variant_div(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+eqv:
+ variant_eqv(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+idiv:
+ variant_idiv(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+imp:
+ variant_imp(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+mod:
+ variant_mod(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+or:
+ variant_or(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+pow:
+ variant_pow(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+xor:
+ variant_xor(hello, 3.5)
+ exception Type mismatch.
+ code 80020005
+
+--
+add: hellohello
+cat: hellohello
+sub:
+ variant_sub(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+mul:
+ variant_mul(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+and:
+ variant_and(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+div:
+ variant_div(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+eqv:
+ variant_eqv(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+idiv:
+ variant_idiv(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+imp:
+ variant_imp(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+mod:
+ variant_mod(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+or:
+ variant_or(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+pow:
+ variant_pow(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+xor:
+ variant_xor(hello, hello)
+ exception Type mismatch.
+ code 80020005
+
+--
+add:
+ variant_add(hello, )
+ exception Type mismatch.
+ code 80020005
+
+cat: helloFalse
+sub:
+ variant_sub(hello, )
+ exception Type mismatch.
+ code 80020005
+
+mul:
+ variant_mul(hello, )
+ exception Type mismatch.
+ code 80020005
+
+and:
+ variant_and(hello, )
+ exception Type mismatch.
+ code 80020005
+
+div:
+ variant_div(hello, )
+ exception Type mismatch.
+ code 80020005
+
+eqv:
+ variant_eqv(hello, )
+ exception Type mismatch.
+ code 80020005
+
+idiv:
+ variant_idiv(hello, )
+ exception Type mismatch.
+ code 80020005
+
+imp:
+ variant_imp(hello, )
+ exception Type mismatch.
+ code 80020005
+
+mod:
+ variant_mod(hello, )
+ exception Type mismatch.
+ code 80020005
+
+or:
+ variant_or(hello, )
+ exception Type mismatch.
+ code 80020005
+
+pow:
+ variant_pow(hello, )
+ exception Type mismatch.
+ code 80020005
+
+xor:
+ variant_xor(hello, )
+ exception Type mismatch.
+ code 80020005
+
+--
+add: 42
+cat: False42
+sub: -42
+mul: 0
+and: 0
+div: 0
+eqv: -43
+idiv: 0
+imp: -1
+mod: 0
+or: 42
+pow: 0
+xor: 42
+--
+add: 3.5
+cat: False3.5
+sub: -3.5
+mul: 0
+and: 0
+div: 0
+eqv: -5
+idiv: 0
+imp: -1
+mod: 0
+or: 4
+pow: 0
+xor: 4
+--
+add:
+ variant_add(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+cat: Falsehello
+sub:
+ variant_sub(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+mul:
+ variant_mul(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+and:
+ variant_and(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+div:
+ variant_div(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+eqv:
+ variant_eqv(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+idiv:
+ variant_idiv(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+imp:
+ variant_imp(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+mod:
+ variant_mod(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+or:
+ variant_or(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+pow:
+ variant_pow(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+xor:
+ variant_xor(0, hello)
+ exception Type mismatch.
+ code 80020005
+
+--
+add: 0
+cat: FalseFalse
+sub: 0
+mul: 0
+and: 0
+div:
+ variant_div(0, )
+ exception Out of present range.
+ code 8002000a
+
+eqv: -1
+idiv:
+ variant_idiv(0, )
+ exception Division by zero.
+ code 80020012
+
+imp: -1
+mod:
+ variant_mod(0, )
+ exception Division by zero.
+ code 80020012
+
+or: 0
+pow: 1
+xor: 0
+OK!
diff --git a/ext/ctype/ctype.c b/ext/ctype/ctype.c
index 41d5559c67..b03afe05f0 100644
--- a/ext/ctype/ctype.c
+++ b/ext/ctype/ctype.c
@@ -148,9 +148,9 @@ static PHP_MINFO_FUNCTION(ctype)
return; \
if (Z_TYPE_P(c) == IS_LONG) { \
if (Z_LVAL_P(c) <= 255 && Z_LVAL_P(c) >= 0) { \
- RETURN_BOOL(iswhat(Z_LVAL_P(c))); \
+ RETURN_BOOL(iswhat((int)Z_LVAL_P(c))); \
} else if (Z_LVAL_P(c) >= -128 && Z_LVAL_P(c) < 0) { \
- RETURN_BOOL(iswhat(Z_LVAL_P(c) + 256)); \
+ RETURN_BOOL(iswhat((int)Z_LVAL_P(c) + 256)); \
} \
tmp = *c; \
zval_copy_ctor(&tmp); \
diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt
index 3bd5889709..d65441b2cc 100644
--- a/ext/curl/tests/bug68089.phpt
+++ b/ext/curl/tests/bug68089.phpt
@@ -13,6 +13,6 @@ var_dump(curl_setopt($ch, CURLOPT_URL, $url));
?>
Done
--EXPECTF--
-Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s/bug68089.php on line 4
+Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s%ebug68089.php on line 4
bool(false)
Done
diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c
index 2a615559f6..f9872a5ce3 100644
--- a/ext/date/lib/parse_date.c
+++ b/ext/date/lib/parse_date.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Tue Aug 26 10:40:19 2014 */
+/* Generated by re2c 0.13.5 on Thu Oct 30 18:16:16 2014 */
#line 1 "ext/date/lib/parse_date.re"
/*
+----------------------------------------------------------------------+
@@ -24712,7 +24712,7 @@ yy1537:
#define YYMAXFILL 31
-timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
+timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
{
Scanner in;
int t;
@@ -24823,7 +24823,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time)
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
}
-timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
+timelib_time *timelib_parse_from_format(char *format, char *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
{
char *fptr = format;
char *ptr = string;
diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re
index cb5df16251..7c4d143368 100644
--- a/ext/date/lib/parse_date.re
+++ b/ext/date/lib/parse_date.re
@@ -1721,7 +1721,7 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of
/*!max:re2c */
-timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
+timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
{
Scanner in;
int t;
@@ -1832,7 +1832,7 @@ static void timelib_time_reset_unset_fields(timelib_time *time)
if (time->f == TIMELIB_UNSET ) time->f = 0.0;
}
-timelib_time *timelib_parse_from_format(char *format, char *string, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
+timelib_time *timelib_parse_from_format(char *format, char *string, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper)
{
char *fptr = format;
char *ptr = string;
diff --git a/ext/date/lib/parse_iso_intervals.c b/ext/date/lib/parse_iso_intervals.c
index 3b7580f9d1..ffa33b0698 100644
--- a/ext/date/lib/parse_iso_intervals.c
+++ b/ext/date/lib/parse_iso_intervals.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Tue Aug 26 10:39:58 2014 */
+/* Generated by re2c 0.13.5 on Thu Oct 30 18:20:16 2014 */
#line 1 "ext/date/lib/parse_iso_intervals.re"
/*
+----------------------------------------------------------------------+
@@ -1004,7 +1004,7 @@ yy100:
#define YYMAXFILL 20
-void timelib_strtointerval(char *s, int len,
+void timelib_strtointerval(char *s, size_t len,
timelib_time **begin, timelib_time **end,
timelib_rel_time **period, int *recurrences,
struct timelib_error_container **errors)
diff --git a/ext/date/lib/parse_iso_intervals.re b/ext/date/lib/parse_iso_intervals.re
index 097488ec57..b400522584 100644
--- a/ext/date/lib/parse_iso_intervals.re
+++ b/ext/date/lib/parse_iso_intervals.re
@@ -398,7 +398,7 @@ isoweek = year4 "-"? "W" weekofyear;
/*!max:re2c */
-void timelib_strtointerval(char *s, int len,
+void timelib_strtointerval(char *s, size_t len,
timelib_time **begin, timelib_time **end,
timelib_rel_time **period, int *recurrences,
struct timelib_error_container **errors)
diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h
index b7c49888cb..552ec39221 100644
--- a/ext/date/lib/timelib.h
+++ b/ext/date/lib/timelib.h
@@ -68,15 +68,15 @@ int timelib_valid_time(timelib_sll h, timelib_sll i, timelib_sll s);
int timelib_valid_date(timelib_sll y, timelib_sll m, timelib_sll d);
/* From parse_date.re */
-timelib_time *timelib_strtotime(char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
-timelib_time *timelib_parse_from_format(char *format, char *s, int len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
+timelib_time *timelib_strtotime(char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
+timelib_time *timelib_parse_from_format(char *format, char *s, size_t len, timelib_error_container **errors, const timelib_tzdb *tzdb, timelib_tz_get_wrapper tz_get_wrapper);
void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options);
char *timelib_timezone_id_from_abbr(const char *abbr, timelib_long gmtoffset, int isdst);
const timelib_tz_lookup_table *timelib_timezone_abbreviations_list(void);
timelib_long timelib_parse_tz_cor(char**);
/* From parse_iso_intervals.re */
-void timelib_strtointerval(char *s, int len,
+void timelib_strtointerval(char *s, size_t len,
timelib_time **begin, timelib_time **end,
timelib_rel_time **period, int *recurrences,
struct timelib_error_container **errors);
diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h
index 98e7b2292c..157f0f4941 100644
--- a/ext/date/lib/timezonedb.h
+++ b/ext/date/lib/timezonedb.h
@@ -1,589 +1,590 @@
-const timelib_tzdb_index_entry timezonedb_idx_builtin[582] = {
+const timelib_tzdb_index_entry timezonedb_idx_builtin[583] = {
{ "Africa/Abidjan" , 0x000000 },
{ "Africa/Accra" , 0x000055 },
{ "Africa/Addis_Ababa" , 0x00019D },
- { "Africa/Algiers" , 0x0001F3 },
- { "Africa/Asmara" , 0x00031E },
- { "Africa/Asmera" , 0x000374 },
- { "Africa/Bamako" , 0x0003CA },
- { "Africa/Bangui" , 0x00041F },
- { "Africa/Banjul" , 0x000474 },
- { "Africa/Bissau" , 0x0004C9 },
- { "Africa/Blantyre" , 0x00052F },
- { "Africa/Brazzaville" , 0x000584 },
- { "Africa/Bujumbura" , 0x0005D9 },
- { "Africa/Cairo" , 0x00062E },
- { "Africa/Casablanca" , 0x000A15 },
- { "Africa/Ceuta" , 0x000C77 },
- { "Africa/Conakry" , 0x000F7E },
- { "Africa/Dakar" , 0x000FD3 },
- { "Africa/Dar_es_Salaam" , 0x001028 },
- { "Africa/Djibouti" , 0x001095 },
- { "Africa/Douala" , 0x0010EA },
- { "Africa/El_Aaiun" , 0x00113F },
- { "Africa/Freetown" , 0x00136A },
- { "Africa/Gaborone" , 0x0013BF },
- { "Africa/Harare" , 0x001414 },
- { "Africa/Johannesburg" , 0x001469 },
- { "Africa/Juba" , 0x0014D7 },
- { "Africa/Kampala" , 0x0015EA },
- { "Africa/Khartoum" , 0x001669 },
- { "Africa/Kigali" , 0x00177C },
- { "Africa/Kinshasa" , 0x0017D1 },
- { "Africa/Lagos" , 0x00183D },
- { "Africa/Libreville" , 0x001892 },
- { "Africa/Lome" , 0x0018E7 },
- { "Africa/Luanda" , 0x00193C },
- { "Africa/Lubumbashi" , 0x001991 },
- { "Africa/Lusaka" , 0x0019FD },
- { "Africa/Malabo" , 0x001A52 },
- { "Africa/Maputo" , 0x001AA7 },
- { "Africa/Maseru" , 0x001AFC },
- { "Africa/Mbabane" , 0x001B6A },
- { "Africa/Mogadishu" , 0x001BD8 },
- { "Africa/Monrovia" , 0x001C33 },
- { "Africa/Nairobi" , 0x001C99 },
- { "Africa/Ndjamena" , 0x001D18 },
- { "Africa/Niamey" , 0x001D84 },
- { "Africa/Nouakchott" , 0x001DD9 },
- { "Africa/Ouagadougou" , 0x001E2E },
- { "Africa/Porto-Novo" , 0x001E83 },
- { "Africa/Sao_Tome" , 0x001ED8 },
- { "Africa/Timbuktu" , 0x001F2D },
- { "Africa/Tripoli" , 0x001F82 },
- { "Africa/Tunis" , 0x00208B },
- { "Africa/Windhoek" , 0x00219D },
- { "America/Adak" , 0x0023E4 },
- { "America/Anchorage" , 0x00275A },
- { "America/Anguilla" , 0x002ACE },
- { "America/Antigua" , 0x002B23 },
- { "America/Araguaina" , 0x002B89 },
- { "America/Argentina/Buenos_Aires" , 0x002CEE },
- { "America/Argentina/Catamarca" , 0x002E9C },
- { "America/Argentina/ComodRivadavia" , 0x00305D },
- { "America/Argentina/Cordoba" , 0x003203 },
- { "America/Argentina/Jujuy" , 0x0033D8 },
- { "America/Argentina/La_Rioja" , 0x00358C },
- { "America/Argentina/Mendoza" , 0x003744 },
- { "America/Argentina/Rio_Gallegos" , 0x003904 },
- { "America/Argentina/Salta" , 0x003AB9 },
- { "America/Argentina/San_Juan" , 0x003C65 },
- { "America/Argentina/San_Luis" , 0x003E1D },
- { "America/Argentina/Tucuman" , 0x003FE3 },
- { "America/Argentina/Ushuaia" , 0x00419F },
- { "America/Aruba" , 0x00435A },
- { "America/Asuncion" , 0x0043C0 },
- { "America/Atikokan" , 0x0046A5 },
- { "America/Atka" , 0x00477B },
- { "America/Bahia" , 0x004AE1 },
- { "America/Bahia_Banderas" , 0x004C74 },
- { "America/Barbados" , 0x004EED },
- { "America/Belem" , 0x004F87 },
- { "America/Belize" , 0x005082 },
- { "America/Blanc-Sablon" , 0x0051FE },
- { "America/Boa_Vista" , 0x0052B2 },
- { "America/Bogota" , 0x0053BB },
- { "America/Boise" , 0x005427 },
- { "America/Buenos_Aires" , 0x0057BE },
- { "America/Cambridge_Bay" , 0x005957 },
- { "America/Campo_Grande" , 0x005C7F },
- { "America/Cancun" , 0x005F6E },
- { "America/Caracas" , 0x0061B0 },
- { "America/Catamarca" , 0x006217 },
- { "America/Cayenne" , 0x0063BD },
- { "America/Cayman" , 0x00641F },
- { "America/Chicago" , 0x006474 },
- { "America/Chihuahua" , 0x00698B },
- { "America/Coral_Harbour" , 0x006BF6 },
- { "America/Cordoba" , 0x006C88 },
- { "America/Costa_Rica" , 0x006E2E },
- { "America/Creston" , 0x006EB8 },
- { "America/Cuiaba" , 0x006F44 },
- { "America/Curacao" , 0x007222 },
- { "America/Danmarkshavn" , 0x007288 },
- { "America/Dawson" , 0x0073CC },
- { "America/Dawson_Creek" , 0x0076E9 },
- { "America/Denver" , 0x0078C3 },
- { "America/Detroit" , 0x007C49 },
- { "America/Dominica" , 0x007FA8 },
- { "America/Edmonton" , 0x007FFD },
- { "America/Eirunepe" , 0x0083B5 },
- { "America/El_Salvador" , 0x0084CD },
- { "America/Ensenada" , 0x008542 },
- { "America/Fort_Wayne" , 0x0089E9 },
- { "America/Fortaleza" , 0x0088AB },
- { "America/Glace_Bay" , 0x008C53 },
- { "America/Godthab" , 0x008FCA },
- { "America/Goose_Bay" , 0x00928E },
- { "America/Grand_Turk" , 0x00974B },
- { "America/Grenada" , 0x009920 },
- { "America/Guadeloupe" , 0x009975 },
- { "America/Guatemala" , 0x0099CA },
- { "America/Guayaquil" , 0x009A53 },
- { "America/Guyana" , 0x009AB0 },
- { "America/Halifax" , 0x009B31 },
- { "America/Havana" , 0x00A047 },
- { "America/Hermosillo" , 0x00A3BA },
- { "America/Indiana/Indianapolis" , 0x00A498 },
- { "America/Indiana/Knox" , 0x00A729 },
- { "America/Indiana/Marengo" , 0x00AAC0 },
- { "America/Indiana/Petersburg" , 0x00AD66 },
- { "America/Indiana/Tell_City" , 0x00B2B3 },
- { "America/Indiana/Vevay" , 0x00B54C },
- { "America/Indiana/Vincennes" , 0x00B787 },
- { "America/Indiana/Winamac" , 0x00BA3B },
- { "America/Indianapolis" , 0x00B049 },
- { "America/Inuvik" , 0x00BCF4 },
- { "America/Iqaluit" , 0x00BFEB },
- { "America/Jamaica" , 0x00C30D },
- { "America/Jujuy" , 0x00C3D2 },
- { "America/Juneau" , 0x00C57C },
- { "America/Kentucky/Louisville" , 0x00C8FA },
- { "America/Kentucky/Monticello" , 0x00CD18 },
- { "America/Knox_IN" , 0x00D09D },
- { "America/Kralendijk" , 0x00D40E },
- { "America/La_Paz" , 0x00D474 },
- { "America/Lima" , 0x00D4DB },
- { "America/Los_Angeles" , 0x00D583 },
- { "America/Louisville" , 0x00D994 },
- { "America/Lower_Princes" , 0x00DD89 },
- { "America/Maceio" , 0x00DDEF },
- { "America/Managua" , 0x00DF29 },
- { "America/Manaus" , 0x00DFDC },
- { "America/Marigot" , 0x00E0DE },
- { "America/Martinique" , 0x00E133 },
- { "America/Matamoros" , 0x00E19F },
- { "America/Mazatlan" , 0x00E3F8 },
- { "America/Mendoza" , 0x00E665 },
- { "America/Menominee" , 0x00E819 },
- { "America/Merida" , 0x00EB9A },
- { "America/Metlakatla" , 0x00EDD5 },
- { "America/Mexico_City" , 0x00EF10 },
- { "America/Miquelon" , 0x00F18B },
- { "America/Moncton" , 0x00F3FD },
- { "America/Monterrey" , 0x00F894 },
- { "America/Montevideo" , 0x00FAF7 },
- { "America/Montreal" , 0x00FE09 },
- { "America/Montserrat" , 0x0102F9 },
- { "America/Nassau" , 0x01034E },
- { "America/New_York" , 0x010693 },
- { "America/Nipigon" , 0x010B9E },
- { "America/Nome" , 0x010EEF },
- { "America/Noronha" , 0x01126D },
- { "America/North_Dakota/Beulah" , 0x01139D },
- { "America/North_Dakota/Center" , 0x011731 },
- { "America/North_Dakota/New_Salem" , 0x011AC5 },
- { "America/Ojinaga" , 0x011E6E },
- { "America/Panama" , 0x0120CF },
- { "America/Pangnirtung" , 0x012124 },
- { "America/Paramaribo" , 0x01245A },
- { "America/Phoenix" , 0x0124EC },
- { "America/Port-au-Prince" , 0x0125AA },
- { "America/Port_of_Spain" , 0x0128CE },
- { "America/Porto_Acre" , 0x0127CA },
- { "America/Porto_Velho" , 0x012923 },
- { "America/Puerto_Rico" , 0x012A19 },
- { "America/Rainy_River" , 0x012A84 },
- { "America/Rankin_Inlet" , 0x012DBC },
- { "America/Recife" , 0x0130A2 },
- { "America/Regina" , 0x0131CC },
- { "America/Resolute" , 0x01338A },
- { "America/Rio_Branco" , 0x013672 },
- { "America/Rosario" , 0x01377A },
- { "America/Santa_Isabel" , 0x013920 },
- { "America/Santarem" , 0x013CC3 },
- { "America/Santiago" , 0x013DC8 },
- { "America/Santo_Domingo" , 0x014171 },
- { "America/Sao_Paulo" , 0x014237 },
- { "America/Scoresbysund" , 0x014546 },
- { "America/Shiprock" , 0x014834 },
- { "America/Sitka" , 0x014BAD },
- { "America/St_Barthelemy" , 0x014F35 },
- { "America/St_Johns" , 0x014F8A },
- { "America/St_Kitts" , 0x0154DD },
- { "America/St_Lucia" , 0x015532 },
- { "America/St_Thomas" , 0x015587 },
- { "America/St_Vincent" , 0x0155DC },
- { "America/Swift_Current" , 0x015631 },
- { "America/Tegucigalpa" , 0x015752 },
- { "America/Thule" , 0x0157D1 },
- { "America/Thunder_Bay" , 0x015A18 },
- { "America/Tijuana" , 0x015D61 },
- { "America/Toronto" , 0x0160FA },
- { "America/Tortola" , 0x01661A },
- { "America/Vancouver" , 0x01666F },
- { "America/Virgin" , 0x016AAC },
- { "America/Whitehorse" , 0x016B01 },
- { "America/Winnipeg" , 0x016E1E },
- { "America/Yakutat" , 0x01725E },
- { "America/Yellowknife" , 0x0175C9 },
- { "Antarctica/Casey" , 0x0178D9 },
- { "Antarctica/Davis" , 0x017977 },
- { "Antarctica/DumontDUrville" , 0x017A18 },
- { "Antarctica/Macquarie" , 0x017AA9 },
- { "Antarctica/Mawson" , 0x017CF6 },
- { "Antarctica/McMurdo" , 0x017D72 },
- { "Antarctica/Palmer" , 0x01811D },
- { "Antarctica/Rothera" , 0x018439 },
- { "Antarctica/South_Pole" , 0x0184AF },
- { "Antarctica/Syowa" , 0x01882D },
- { "Antarctica/Troll" , 0x01889B },
- { "Antarctica/Vostok" , 0x018A6D },
- { "Arctic/Longyearbyen" , 0x018ADE },
- { "Asia/Aden" , 0x018E10 },
- { "Asia/Almaty" , 0x018E65 },
- { "Asia/Amman" , 0x018FE4 },
- { "Asia/Anadyr" , 0x01929A },
- { "Asia/Aqtau" , 0x01949C },
- { "Asia/Aqtobe" , 0x01969B },
- { "Asia/Ashgabat" , 0x019853 },
- { "Asia/Ashkhabad" , 0x019970 },
- { "Asia/Baghdad" , 0x019A8D },
- { "Asia/Bahrain" , 0x019C02 },
- { "Asia/Baku" , 0x019C68 },
- { "Asia/Bangkok" , 0x019F50 },
- { "Asia/Beirut" , 0x019FA5 },
- { "Asia/Bishkek" , 0x01A2B2 },
- { "Asia/Brunei" , 0x01A45E },
- { "Asia/Calcutta" , 0x01A4C0 },
- { "Asia/Chita" , 0x01A539 },
- { "Asia/Choibalsan" , 0x01A74E },
- { "Asia/Chongqing" , 0x01A8C7 },
- { "Asia/Chungking" , 0x01A967 },
- { "Asia/Colombo" , 0x01AA07 },
- { "Asia/Dacca" , 0x01AAA3 },
- { "Asia/Damascus" , 0x01AB49 },
- { "Asia/Dhaka" , 0x01AE99 },
- { "Asia/Dili" , 0x01AF3F },
- { "Asia/Dubai" , 0x01AFC9 },
- { "Asia/Dushanbe" , 0x01B01E },
- { "Asia/Gaza" , 0x01B121 },
- { "Asia/Harbin" , 0x01B474 },
- { "Asia/Hebron" , 0x01B514 },
- { "Asia/Ho_Chi_Minh" , 0x01B870 },
- { "Asia/Hong_Kong" , 0x01B8E8 },
- { "Asia/Hovd" , 0x01BAAA },
- { "Asia/Irkutsk" , 0x01BC22 },
- { "Asia/Istanbul" , 0x01BE0D },
- { "Asia/Jakarta" , 0x01C1FA },
- { "Asia/Jayapura" , 0x01C2A4 },
- { "Asia/Jerusalem" , 0x01C341 },
- { "Asia/Kabul" , 0x01C670 },
- { "Asia/Kamchatka" , 0x01C6C1 },
- { "Asia/Karachi" , 0x01C8BA },
- { "Asia/Kashgar" , 0x01C96F },
- { "Asia/Kathmandu" , 0x01C9C4 },
- { "Asia/Katmandu" , 0x01CA2A },
- { "Asia/Khandyga" , 0x01CA90 },
- { "Asia/Kolkata" , 0x01CCBA },
- { "Asia/Krasnoyarsk" , 0x01CD33 },
- { "Asia/Kuala_Lumpur" , 0x01CF20 },
- { "Asia/Kuching" , 0x01CFDD },
- { "Asia/Kuwait" , 0x01D0CB },
- { "Asia/Macao" , 0x01D120 },
- { "Asia/Macau" , 0x01D25B },
- { "Asia/Magadan" , 0x01D396 },
- { "Asia/Makassar" , 0x01D59A },
- { "Asia/Manila" , 0x01D65F },
- { "Asia/Muscat" , 0x01D6E4 },
- { "Asia/Nicosia" , 0x01D739 },
- { "Asia/Novokuznetsk" , 0x01DA21 },
- { "Asia/Novosibirsk" , 0x01DC41 },
- { "Asia/Omsk" , 0x01DE31 },
- { "Asia/Oral" , 0x01E01D },
- { "Asia/Phnom_Penh" , 0x01E1ED },
- { "Asia/Pontianak" , 0x01E265 },
- { "Asia/Pyongyang" , 0x01E327 },
- { "Asia/Qatar" , 0x01E3B7 },
- { "Asia/Qyzylorda" , 0x01E41D },
- { "Asia/Rangoon" , 0x01E5F3 },
- { "Asia/Riyadh" , 0x01E66B },
- { "Asia/Saigon" , 0x01E6C0 },
- { "Asia/Sakhalin" , 0x01E738 },
- { "Asia/Samarkand" , 0x01E935 },
- { "Asia/Seoul" , 0x01EA6B },
- { "Asia/Shanghai" , 0x01EB32 },
- { "Asia/Singapore" , 0x01EBDE },
- { "Asia/Srednekolymsk" , 0x01EC95 },
- { "Asia/Taipei" , 0x01EE95 },
- { "Asia/Tashkent" , 0x01EFC6 },
- { "Asia/Tbilisi" , 0x01F0F7 },
- { "Asia/Tehran" , 0x01F2B1 },
- { "Asia/Tel_Aviv" , 0x01F51F },
- { "Asia/Thimbu" , 0x01F84E },
- { "Asia/Thimphu" , 0x01F8B4 },
- { "Asia/Tokyo" , 0x01F91A },
- { "Asia/Ujung_Pandang" , 0x01F9A4 },
- { "Asia/Ulaanbaatar" , 0x01FA21 },
- { "Asia/Ulan_Bator" , 0x01FB7C },
- { "Asia/Urumqi" , 0x01FCC9 },
- { "Asia/Ust-Nera" , 0x01FD2B },
- { "Asia/Vientiane" , 0x01FF3D },
- { "Asia/Vladivostok" , 0x01FFB5 },
- { "Asia/Yakutsk" , 0x02019F },
- { "Asia/Yekaterinburg" , 0x020389 },
- { "Asia/Yerevan" , 0x0205AA },
- { "Atlantic/Azores" , 0x0207AA },
- { "Atlantic/Bermuda" , 0x020CAD },
- { "Atlantic/Canary" , 0x020F8E },
- { "Atlantic/Cape_Verde" , 0x021264 },
- { "Atlantic/Faeroe" , 0x0212DD },
- { "Atlantic/Faroe" , 0x021581 },
- { "Atlantic/Jan_Mayen" , 0x021825 },
- { "Atlantic/Madeira" , 0x021B57 },
- { "Atlantic/Reykjavik" , 0x022060 },
- { "Atlantic/South_Georgia" , 0x022219 },
- { "Atlantic/St_Helena" , 0x02242B },
- { "Atlantic/Stanley" , 0x02225D },
- { "Australia/ACT" , 0x022480 },
- { "Australia/Adelaide" , 0x0227A3 },
- { "Australia/Brisbane" , 0x022AD5 },
- { "Australia/Broken_Hill" , 0x022BA2 },
- { "Australia/Canberra" , 0x022EE6 },
- { "Australia/Currie" , 0x023209 },
- { "Australia/Darwin" , 0x023542 },
- { "Australia/Eucla" , 0x0235CE },
- { "Australia/Hobart" , 0x0236AA },
- { "Australia/LHI" , 0x023A0E },
- { "Australia/Lindeman" , 0x023CAF },
- { "Australia/Lord_Howe" , 0x023D96 },
- { "Australia/Melbourne" , 0x024047 },
- { "Australia/North" , 0x024372 },
- { "Australia/NSW" , 0x0243EC },
- { "Australia/Perth" , 0x02470F },
- { "Australia/Queensland" , 0x0247ED },
- { "Australia/South" , 0x02489F },
- { "Australia/Sydney" , 0x024BC2 },
- { "Australia/Tasmania" , 0x024F05 },
- { "Australia/Victoria" , 0x025250 },
- { "Australia/West" , 0x025573 },
- { "Australia/Yancowinna" , 0x02562F },
- { "Brazil/Acre" , 0x025957 },
- { "Brazil/DeNoronha" , 0x025A5B },
- { "Brazil/East" , 0x025B7B },
- { "Brazil/West" , 0x025E58 },
- { "Canada/Atlantic" , 0x025F50 },
- { "Canada/Central" , 0x026438 },
- { "Canada/East-Saskatchewan" , 0x026D42 },
- { "Canada/Eastern" , 0x026852 },
- { "Canada/Mountain" , 0x026ECB },
- { "Canada/Newfoundland" , 0x027241 },
- { "Canada/Pacific" , 0x02776C },
- { "Canada/Saskatchewan" , 0x027B85 },
- { "Canada/Yukon" , 0x027D0E },
- { "CET" , 0x028011 },
- { "Chile/Continental" , 0x02831A },
- { "Chile/EasterIsland" , 0x0286B5 },
- { "CST6CDT" , 0x0289F7 },
- { "Cuba" , 0x028D48 },
- { "EET" , 0x0290BB },
- { "Egypt" , 0x02936E },
- { "Eire" , 0x029755 },
- { "EST" , 0x029C66 },
- { "EST5EDT" , 0x029CAA },
- { "Etc/GMT" , 0x029FFB },
- { "Etc/GMT+0" , 0x02A0C7 },
- { "Etc/GMT+1" , 0x02A151 },
- { "Etc/GMT+10" , 0x02A1DE },
- { "Etc/GMT+11" , 0x02A26C },
- { "Etc/GMT+12" , 0x02A2FA },
- { "Etc/GMT+2" , 0x02A415 },
- { "Etc/GMT+3" , 0x02A4A1 },
- { "Etc/GMT+4" , 0x02A52D },
- { "Etc/GMT+5" , 0x02A5B9 },
- { "Etc/GMT+6" , 0x02A645 },
- { "Etc/GMT+7" , 0x02A6D1 },
- { "Etc/GMT+8" , 0x02A75D },
- { "Etc/GMT+9" , 0x02A7E9 },
- { "Etc/GMT-0" , 0x02A083 },
- { "Etc/GMT-1" , 0x02A10B },
- { "Etc/GMT-10" , 0x02A197 },
- { "Etc/GMT-11" , 0x02A225 },
- { "Etc/GMT-12" , 0x02A2B3 },
- { "Etc/GMT-13" , 0x02A341 },
- { "Etc/GMT-14" , 0x02A388 },
- { "Etc/GMT-2" , 0x02A3CF },
- { "Etc/GMT-3" , 0x02A45B },
- { "Etc/GMT-4" , 0x02A4E7 },
- { "Etc/GMT-5" , 0x02A573 },
- { "Etc/GMT-6" , 0x02A5FF },
- { "Etc/GMT-7" , 0x02A68B },
- { "Etc/GMT-8" , 0x02A717 },
- { "Etc/GMT-9" , 0x02A7A3 },
- { "Etc/GMT0" , 0x02A03F },
- { "Etc/Greenwich" , 0x02A82F },
- { "Etc/UCT" , 0x02A873 },
- { "Etc/Universal" , 0x02A8B7 },
- { "Etc/UTC" , 0x02A8FB },
- { "Etc/Zulu" , 0x02A93F },
- { "Europe/Amsterdam" , 0x02A983 },
- { "Europe/Andorra" , 0x02ADC1 },
- { "Europe/Athens" , 0x02B03D },
- { "Europe/Belfast" , 0x02B380 },
- { "Europe/Belgrade" , 0x02B8B7 },
- { "Europe/Berlin" , 0x02BB80 },
- { "Europe/Bratislava" , 0x02BEE4 },
- { "Europe/Brussels" , 0x02C216 },
- { "Europe/Bucharest" , 0x02C64D },
- { "Europe/Budapest" , 0x02C977 },
- { "Europe/Busingen" , 0x02CCE0 },
- { "Europe/Chisinau" , 0x02CF97 },
- { "Europe/Copenhagen" , 0x02D325 },
- { "Europe/Dublin" , 0x02D62F },
- { "Europe/Gibraltar" , 0x02DB40 },
- { "Europe/Guernsey" , 0x02DF97 },
- { "Europe/Helsinki" , 0x02E4CE },
- { "Europe/Isle_of_Man" , 0x02E784 },
- { "Europe/Istanbul" , 0x02ECBB },
- { "Europe/Jersey" , 0x02F0A8 },
- { "Europe/Kaliningrad" , 0x02F5DF },
- { "Europe/Kiev" , 0x02F84A },
- { "Europe/Lisbon" , 0x02FB66 },
- { "Europe/Ljubljana" , 0x03006A },
- { "Europe/London" , 0x030333 },
- { "Europe/Luxembourg" , 0x03086A },
- { "Europe/Madrid" , 0x030CC0 },
- { "Europe/Malta" , 0x031086 },
- { "Europe/Mariehamn" , 0x03143F },
- { "Europe/Minsk" , 0x0316F5 },
- { "Europe/Monaco" , 0x031903 },
- { "Europe/Moscow" , 0x031D3E },
- { "Europe/Nicosia" , 0x031F98 },
- { "Europe/Oslo" , 0x032280 },
- { "Europe/Paris" , 0x0325B2 },
- { "Europe/Podgorica" , 0x0329F8 },
- { "Europe/Prague" , 0x032CC1 },
- { "Europe/Riga" , 0x032FF3 },
- { "Europe/Rome" , 0x033338 },
- { "Europe/Samara" , 0x0336FB },
- { "Europe/San_Marino" , 0x033964 },
- { "Europe/Sarajevo" , 0x033D27 },
- { "Europe/Simferopol" , 0x033FF0 },
- { "Europe/Skopje" , 0x034241 },
- { "Europe/Sofia" , 0x03450A },
- { "Europe/Stockholm" , 0x034812 },
- { "Europe/Tallinn" , 0x034AC1 },
- { "Europe/Tirane" , 0x034DFB },
- { "Europe/Tiraspol" , 0x035101 },
- { "Europe/Uzhgorod" , 0x03548F },
- { "Europe/Vaduz" , 0x0357A6 },
- { "Europe/Vatican" , 0x035A55 },
- { "Europe/Vienna" , 0x035E18 },
- { "Europe/Vilnius" , 0x036145 },
- { "Europe/Volgograd" , 0x036484 },
- { "Europe/Warsaw" , 0x0366A5 },
- { "Europe/Zagreb" , 0x036A86 },
- { "Europe/Zaporozhye" , 0x036D4F },
- { "Europe/Zurich" , 0x037090 },
- { "Factory" , 0x03733F },
- { "GB" , 0x0373B0 },
- { "GB-Eire" , 0x0378E7 },
- { "GMT" , 0x037E1E },
- { "GMT+0" , 0x037EEA },
- { "GMT-0" , 0x037EA6 },
- { "GMT0" , 0x037E62 },
- { "Greenwich" , 0x037F2E },
- { "Hongkong" , 0x037F72 },
- { "HST" , 0x038134 },
- { "Iceland" , 0x038178 },
- { "Indian/Antananarivo" , 0x038331 },
- { "Indian/Chagos" , 0x0383A5 },
- { "Indian/Christmas" , 0x038407 },
- { "Indian/Cocos" , 0x03844B },
- { "Indian/Comoro" , 0x03848F },
- { "Indian/Kerguelen" , 0x0384E4 },
- { "Indian/Mahe" , 0x038539 },
- { "Indian/Maldives" , 0x03858E },
- { "Indian/Mauritius" , 0x0385E3 },
- { "Indian/Mayotte" , 0x038659 },
- { "Indian/Reunion" , 0x0386AE },
- { "Iran" , 0x038703 },
- { "Israel" , 0x038971 },
- { "Jamaica" , 0x038CA0 },
- { "Japan" , 0x038D65 },
- { "Kwajalein" , 0x038DEF },
- { "Libya" , 0x038E52 },
- { "MET" , 0x038F5B },
- { "Mexico/BajaNorte" , 0x039264 },
- { "Mexico/BajaSur" , 0x0395CD },
- { "Mexico/General" , 0x039812 },
- { "MST" , 0x039A70 },
- { "MST7MDT" , 0x039AB4 },
- { "Navajo" , 0x039E05 },
- { "NZ" , 0x03A17E },
- { "NZ-CHAT" , 0x03A4FC },
- { "Pacific/Apia" , 0x03A7E0 },
- { "Pacific/Auckland" , 0x03A97C },
- { "Pacific/Chatham" , 0x03AD08 },
- { "Pacific/Chuuk" , 0x03AFFB },
- { "Pacific/Easter" , 0x03B054 },
- { "Pacific/Efate" , 0x03B3A3 },
- { "Pacific/Enderbury" , 0x03B469 },
- { "Pacific/Fakaofo" , 0x03B4D7 },
- { "Pacific/Fiji" , 0x03B528 },
- { "Pacific/Funafuti" , 0x03B6BB },
- { "Pacific/Galapagos" , 0x03B6FF },
- { "Pacific/Gambier" , 0x03B777 },
- { "Pacific/Guadalcanal" , 0x03B7DC },
- { "Pacific/Guam" , 0x03B831 },
- { "Pacific/Honolulu" , 0x03B887 },
- { "Pacific/Johnston" , 0x03B8FE },
- { "Pacific/Kiritimati" , 0x03B97D },
- { "Pacific/Kosrae" , 0x03B9E8 },
- { "Pacific/Kwajalein" , 0x03BA45 },
- { "Pacific/Majuro" , 0x03BAB1 },
- { "Pacific/Marquesas" , 0x03BB10 },
- { "Pacific/Midway" , 0x03BB77 },
- { "Pacific/Nauru" , 0x03BC01 },
- { "Pacific/Niue" , 0x03BC79 },
- { "Pacific/Norfolk" , 0x03BCD7 },
- { "Pacific/Noumea" , 0x03BD2C },
- { "Pacific/Pago_Pago" , 0x03BDBC },
- { "Pacific/Palau" , 0x03BE33 },
- { "Pacific/Pitcairn" , 0x03BE77 },
- { "Pacific/Pohnpei" , 0x03BECC },
- { "Pacific/Ponape" , 0x03BF21 },
- { "Pacific/Port_Moresby" , 0x03BF66 },
- { "Pacific/Rarotonga" , 0x03BFAA },
- { "Pacific/Saipan" , 0x03C086 },
- { "Pacific/Samoa" , 0x03C0E9 },
- { "Pacific/Tahiti" , 0x03C160 },
- { "Pacific/Tarawa" , 0x03C1C5 },
- { "Pacific/Tongatapu" , 0x03C219 },
- { "Pacific/Truk" , 0x03C2A5 },
- { "Pacific/Wake" , 0x03C2EA },
- { "Pacific/Wallis" , 0x03C33A },
- { "Pacific/Yap" , 0x03C37E },
- { "Poland" , 0x03C3C3 },
- { "Portugal" , 0x03C7A4 },
- { "PRC" , 0x03CCA0 },
- { "PST8PDT" , 0x03CD40 },
- { "ROC" , 0x03D091 },
- { "ROK" , 0x03D1C2 },
- { "Singapore" , 0x03D289 },
- { "Turkey" , 0x03D340 },
- { "UCT" , 0x03D72D },
- { "Universal" , 0x03D771 },
- { "US/Alaska" , 0x03D7B5 },
- { "US/Aleutian" , 0x03DB1E },
- { "US/Arizona" , 0x03DE84 },
- { "US/Central" , 0x03DF12 },
- { "US/East-Indiana" , 0x03E91C },
- { "US/Eastern" , 0x03E41D },
- { "US/Hawaii" , 0x03EB86 },
- { "US/Indiana-Starke" , 0x03EBF7 },
- { "US/Michigan" , 0x03EF68 },
- { "US/Mountain" , 0x03F29F },
- { "US/Pacific" , 0x03F618 },
- { "US/Pacific-New" , 0x03FA1D },
- { "US/Samoa" , 0x03FE22 },
- { "UTC" , 0x03FE99 },
- { "W-SU" , 0x040190 },
- { "WET" , 0x03FEDD },
- { "Zulu" , 0x0403D3 },
+ { "Africa/Algiers" , 0x00021C },
+ { "Africa/Asmara" , 0x000347 },
+ { "Africa/Asmera" , 0x0003C6 },
+ { "Africa/Bamako" , 0x000445 },
+ { "Africa/Bangui" , 0x00049A },
+ { "Africa/Banjul" , 0x0004EF },
+ { "Africa/Bissau" , 0x000544 },
+ { "Africa/Blantyre" , 0x0005AA },
+ { "Africa/Brazzaville" , 0x0005FF },
+ { "Africa/Bujumbura" , 0x000654 },
+ { "Africa/Cairo" , 0x0006A9 },
+ { "Africa/Casablanca" , 0x000A90 },
+ { "Africa/Ceuta" , 0x000CF2 },
+ { "Africa/Conakry" , 0x000FF9 },
+ { "Africa/Dakar" , 0x00104E },
+ { "Africa/Dar_es_Salaam" , 0x0010A3 },
+ { "Africa/Djibouti" , 0x001122 },
+ { "Africa/Douala" , 0x0011A1 },
+ { "Africa/El_Aaiun" , 0x0011F6 },
+ { "Africa/Freetown" , 0x001421 },
+ { "Africa/Gaborone" , 0x001476 },
+ { "Africa/Harare" , 0x0014CB },
+ { "Africa/Johannesburg" , 0x001520 },
+ { "Africa/Juba" , 0x00158E },
+ { "Africa/Kampala" , 0x0016A1 },
+ { "Africa/Khartoum" , 0x001720 },
+ { "Africa/Kigali" , 0x001833 },
+ { "Africa/Kinshasa" , 0x001888 },
+ { "Africa/Lagos" , 0x0018F4 },
+ { "Africa/Libreville" , 0x001949 },
+ { "Africa/Lome" , 0x00199E },
+ { "Africa/Luanda" , 0x0019F3 },
+ { "Africa/Lubumbashi" , 0x001A48 },
+ { "Africa/Lusaka" , 0x001AB4 },
+ { "Africa/Malabo" , 0x001B09 },
+ { "Africa/Maputo" , 0x001B5E },
+ { "Africa/Maseru" , 0x001BB3 },
+ { "Africa/Mbabane" , 0x001C21 },
+ { "Africa/Mogadishu" , 0x001C8F },
+ { "Africa/Monrovia" , 0x001D0E },
+ { "Africa/Nairobi" , 0x001D74 },
+ { "Africa/Ndjamena" , 0x001DF3 },
+ { "Africa/Niamey" , 0x001E5F },
+ { "Africa/Nouakchott" , 0x001EB4 },
+ { "Africa/Ouagadougou" , 0x001F09 },
+ { "Africa/Porto-Novo" , 0x001F5E },
+ { "Africa/Sao_Tome" , 0x001FB3 },
+ { "Africa/Timbuktu" , 0x002008 },
+ { "Africa/Tripoli" , 0x00205D },
+ { "Africa/Tunis" , 0x002166 },
+ { "Africa/Windhoek" , 0x002278 },
+ { "America/Adak" , 0x0024BF },
+ { "America/Anchorage" , 0x002835 },
+ { "America/Anguilla" , 0x002BA9 },
+ { "America/Antigua" , 0x002BFE },
+ { "America/Araguaina" , 0x002C64 },
+ { "America/Argentina/Buenos_Aires" , 0x002DC9 },
+ { "America/Argentina/Catamarca" , 0x002F77 },
+ { "America/Argentina/ComodRivadavia" , 0x003138 },
+ { "America/Argentina/Cordoba" , 0x0032DE },
+ { "America/Argentina/Jujuy" , 0x0034B3 },
+ { "America/Argentina/La_Rioja" , 0x003667 },
+ { "America/Argentina/Mendoza" , 0x00381F },
+ { "America/Argentina/Rio_Gallegos" , 0x0039DF },
+ { "America/Argentina/Salta" , 0x003B94 },
+ { "America/Argentina/San_Juan" , 0x003D40 },
+ { "America/Argentina/San_Luis" , 0x003EF8 },
+ { "America/Argentina/Tucuman" , 0x0040BE },
+ { "America/Argentina/Ushuaia" , 0x00427A },
+ { "America/Aruba" , 0x004435 },
+ { "America/Asuncion" , 0x00449B },
+ { "America/Atikokan" , 0x004780 },
+ { "America/Atka" , 0x004856 },
+ { "America/Bahia" , 0x004BBC },
+ { "America/Bahia_Banderas" , 0x004D4F },
+ { "America/Barbados" , 0x004FC8 },
+ { "America/Belem" , 0x005062 },
+ { "America/Belize" , 0x00515D },
+ { "America/Blanc-Sablon" , 0x0052D9 },
+ { "America/Boa_Vista" , 0x00538D },
+ { "America/Bogota" , 0x005496 },
+ { "America/Boise" , 0x005502 },
+ { "America/Buenos_Aires" , 0x005899 },
+ { "America/Cambridge_Bay" , 0x005A32 },
+ { "America/Campo_Grande" , 0x005D5A },
+ { "America/Cancun" , 0x006049 },
+ { "America/Caracas" , 0x00628B },
+ { "America/Catamarca" , 0x0062F2 },
+ { "America/Cayenne" , 0x006498 },
+ { "America/Cayman" , 0x0064FA },
+ { "America/Chicago" , 0x00654F },
+ { "America/Chihuahua" , 0x006A66 },
+ { "America/Coral_Harbour" , 0x006CD1 },
+ { "America/Cordoba" , 0x006D63 },
+ { "America/Costa_Rica" , 0x006F09 },
+ { "America/Creston" , 0x006F93 },
+ { "America/Cuiaba" , 0x00701F },
+ { "America/Curacao" , 0x0072FD },
+ { "America/Danmarkshavn" , 0x007363 },
+ { "America/Dawson" , 0x0074A7 },
+ { "America/Dawson_Creek" , 0x0077C4 },
+ { "America/Denver" , 0x00799E },
+ { "America/Detroit" , 0x007D24 },
+ { "America/Dominica" , 0x008083 },
+ { "America/Edmonton" , 0x0080D8 },
+ { "America/Eirunepe" , 0x008490 },
+ { "America/El_Salvador" , 0x0085A8 },
+ { "America/Ensenada" , 0x00861D },
+ { "America/Fort_Wayne" , 0x008AC4 },
+ { "America/Fortaleza" , 0x008986 },
+ { "America/Glace_Bay" , 0x008D2E },
+ { "America/Godthab" , 0x0090A5 },
+ { "America/Goose_Bay" , 0x009369 },
+ { "America/Grand_Turk" , 0x009826 },
+ { "America/Grenada" , 0x009A05 },
+ { "America/Guadeloupe" , 0x009A5A },
+ { "America/Guatemala" , 0x009AAF },
+ { "America/Guayaquil" , 0x009B38 },
+ { "America/Guyana" , 0x009B95 },
+ { "America/Halifax" , 0x009C16 },
+ { "America/Havana" , 0x00A12C },
+ { "America/Hermosillo" , 0x00A49F },
+ { "America/Indiana/Indianapolis" , 0x00A57D },
+ { "America/Indiana/Knox" , 0x00A80E },
+ { "America/Indiana/Marengo" , 0x00ABA5 },
+ { "America/Indiana/Petersburg" , 0x00AE4B },
+ { "America/Indiana/Tell_City" , 0x00B398 },
+ { "America/Indiana/Vevay" , 0x00B631 },
+ { "America/Indiana/Vincennes" , 0x00B86C },
+ { "America/Indiana/Winamac" , 0x00BB20 },
+ { "America/Indianapolis" , 0x00B12E },
+ { "America/Inuvik" , 0x00BDD9 },
+ { "America/Iqaluit" , 0x00C0D0 },
+ { "America/Jamaica" , 0x00C3F2 },
+ { "America/Jujuy" , 0x00C4B7 },
+ { "America/Juneau" , 0x00C661 },
+ { "America/Kentucky/Louisville" , 0x00C9DF },
+ { "America/Kentucky/Monticello" , 0x00CDFD },
+ { "America/Knox_IN" , 0x00D182 },
+ { "America/Kralendijk" , 0x00D4F3 },
+ { "America/La_Paz" , 0x00D559 },
+ { "America/Lima" , 0x00D5C0 },
+ { "America/Los_Angeles" , 0x00D668 },
+ { "America/Louisville" , 0x00DA79 },
+ { "America/Lower_Princes" , 0x00DE6E },
+ { "America/Maceio" , 0x00DED4 },
+ { "America/Managua" , 0x00E00E },
+ { "America/Manaus" , 0x00E0C1 },
+ { "America/Marigot" , 0x00E1C3 },
+ { "America/Martinique" , 0x00E218 },
+ { "America/Matamoros" , 0x00E284 },
+ { "America/Mazatlan" , 0x00E4DD },
+ { "America/Mendoza" , 0x00E74A },
+ { "America/Menominee" , 0x00E8FE },
+ { "America/Merida" , 0x00EC7F },
+ { "America/Metlakatla" , 0x00EEBA },
+ { "America/Mexico_City" , 0x00EFF5 },
+ { "America/Miquelon" , 0x00F270 },
+ { "America/Moncton" , 0x00F4E2 },
+ { "America/Monterrey" , 0x00F979 },
+ { "America/Montevideo" , 0x00FBDC },
+ { "America/Montreal" , 0x00FEEE },
+ { "America/Montserrat" , 0x0103DE },
+ { "America/Nassau" , 0x010433 },
+ { "America/New_York" , 0x010778 },
+ { "America/Nipigon" , 0x010C83 },
+ { "America/Nome" , 0x010FD4 },
+ { "America/Noronha" , 0x011352 },
+ { "America/North_Dakota/Beulah" , 0x011482 },
+ { "America/North_Dakota/Center" , 0x011816 },
+ { "America/North_Dakota/New_Salem" , 0x011BAA },
+ { "America/Ojinaga" , 0x011F53 },
+ { "America/Panama" , 0x0121B4 },
+ { "America/Pangnirtung" , 0x012209 },
+ { "America/Paramaribo" , 0x01253F },
+ { "America/Phoenix" , 0x0125D1 },
+ { "America/Port-au-Prince" , 0x01268F },
+ { "America/Port_of_Spain" , 0x0129B3 },
+ { "America/Porto_Acre" , 0x0128AF },
+ { "America/Porto_Velho" , 0x012A08 },
+ { "America/Puerto_Rico" , 0x012AFE },
+ { "America/Rainy_River" , 0x012B69 },
+ { "America/Rankin_Inlet" , 0x012EA1 },
+ { "America/Recife" , 0x013187 },
+ { "America/Regina" , 0x0132B1 },
+ { "America/Resolute" , 0x01346F },
+ { "America/Rio_Branco" , 0x013757 },
+ { "America/Rosario" , 0x01385F },
+ { "America/Santa_Isabel" , 0x013A05 },
+ { "America/Santarem" , 0x013DA8 },
+ { "America/Santiago" , 0x013EAD },
+ { "America/Santo_Domingo" , 0x014256 },
+ { "America/Sao_Paulo" , 0x01431C },
+ { "America/Scoresbysund" , 0x01462B },
+ { "America/Shiprock" , 0x014919 },
+ { "America/Sitka" , 0x014C92 },
+ { "America/St_Barthelemy" , 0x01501A },
+ { "America/St_Johns" , 0x01506F },
+ { "America/St_Kitts" , 0x0155C2 },
+ { "America/St_Lucia" , 0x015617 },
+ { "America/St_Thomas" , 0x01566C },
+ { "America/St_Vincent" , 0x0156C1 },
+ { "America/Swift_Current" , 0x015716 },
+ { "America/Tegucigalpa" , 0x015837 },
+ { "America/Thule" , 0x0158B6 },
+ { "America/Thunder_Bay" , 0x015AFD },
+ { "America/Tijuana" , 0x015E46 },
+ { "America/Toronto" , 0x0161DF },
+ { "America/Tortola" , 0x0166FF },
+ { "America/Vancouver" , 0x016754 },
+ { "America/Virgin" , 0x016B91 },
+ { "America/Whitehorse" , 0x016BE6 },
+ { "America/Winnipeg" , 0x016F03 },
+ { "America/Yakutat" , 0x017343 },
+ { "America/Yellowknife" , 0x0176AE },
+ { "Antarctica/Casey" , 0x0179BE },
+ { "Antarctica/Davis" , 0x017A5C },
+ { "Antarctica/DumontDUrville" , 0x017AFD },
+ { "Antarctica/Macquarie" , 0x017B8E },
+ { "Antarctica/Mawson" , 0x017DDB },
+ { "Antarctica/McMurdo" , 0x017E57 },
+ { "Antarctica/Palmer" , 0x018202 },
+ { "Antarctica/Rothera" , 0x01851E },
+ { "Antarctica/South_Pole" , 0x018594 },
+ { "Antarctica/Syowa" , 0x018912 },
+ { "Antarctica/Troll" , 0x018980 },
+ { "Antarctica/Vostok" , 0x018B52 },
+ { "Arctic/Longyearbyen" , 0x018BC3 },
+ { "Asia/Aden" , 0x018EF5 },
+ { "Asia/Almaty" , 0x018F4A },
+ { "Asia/Amman" , 0x0190C9 },
+ { "Asia/Anadyr" , 0x01937F },
+ { "Asia/Aqtau" , 0x019581 },
+ { "Asia/Aqtobe" , 0x019780 },
+ { "Asia/Ashgabat" , 0x019938 },
+ { "Asia/Ashkhabad" , 0x019A55 },
+ { "Asia/Baghdad" , 0x019B72 },
+ { "Asia/Bahrain" , 0x019CE7 },
+ { "Asia/Baku" , 0x019D4D },
+ { "Asia/Bangkok" , 0x01A035 },
+ { "Asia/Beirut" , 0x01A08A },
+ { "Asia/Bishkek" , 0x01A397 },
+ { "Asia/Brunei" , 0x01A543 },
+ { "Asia/Calcutta" , 0x01A5A5 },
+ { "Asia/Chita" , 0x01A61E },
+ { "Asia/Choibalsan" , 0x01A833 },
+ { "Asia/Chongqing" , 0x01A9AC },
+ { "Asia/Chungking" , 0x01AA4C },
+ { "Asia/Colombo" , 0x01AAEC },
+ { "Asia/Dacca" , 0x01AB88 },
+ { "Asia/Damascus" , 0x01AC2E },
+ { "Asia/Dhaka" , 0x01AF7E },
+ { "Asia/Dili" , 0x01B024 },
+ { "Asia/Dubai" , 0x01B0AE },
+ { "Asia/Dushanbe" , 0x01B103 },
+ { "Asia/Gaza" , 0x01B206 },
+ { "Asia/Harbin" , 0x01B559 },
+ { "Asia/Hebron" , 0x01B5F9 },
+ { "Asia/Ho_Chi_Minh" , 0x01B955 },
+ { "Asia/Hong_Kong" , 0x01B9F7 },
+ { "Asia/Hovd" , 0x01BBB9 },
+ { "Asia/Irkutsk" , 0x01BD31 },
+ { "Asia/Istanbul" , 0x01BF1C },
+ { "Asia/Jakarta" , 0x01C309 },
+ { "Asia/Jayapura" , 0x01C3B3 },
+ { "Asia/Jerusalem" , 0x01C450 },
+ { "Asia/Kabul" , 0x01C77F },
+ { "Asia/Kamchatka" , 0x01C7D0 },
+ { "Asia/Karachi" , 0x01C9C9 },
+ { "Asia/Kashgar" , 0x01CA7E },
+ { "Asia/Kathmandu" , 0x01CAD3 },
+ { "Asia/Katmandu" , 0x01CB39 },
+ { "Asia/Khandyga" , 0x01CB9F },
+ { "Asia/Kolkata" , 0x01CDC9 },
+ { "Asia/Krasnoyarsk" , 0x01CE42 },
+ { "Asia/Kuala_Lumpur" , 0x01D02F },
+ { "Asia/Kuching" , 0x01D0EC },
+ { "Asia/Kuwait" , 0x01D1DA },
+ { "Asia/Macao" , 0x01D22F },
+ { "Asia/Macau" , 0x01D36A },
+ { "Asia/Magadan" , 0x01D4A5 },
+ { "Asia/Makassar" , 0x01D6A9 },
+ { "Asia/Manila" , 0x01D76E },
+ { "Asia/Muscat" , 0x01D7F3 },
+ { "Asia/Nicosia" , 0x01D848 },
+ { "Asia/Novokuznetsk" , 0x01DB30 },
+ { "Asia/Novosibirsk" , 0x01DD50 },
+ { "Asia/Omsk" , 0x01DF40 },
+ { "Asia/Oral" , 0x01E12C },
+ { "Asia/Phnom_Penh" , 0x01E2FC },
+ { "Asia/Pontianak" , 0x01E351 },
+ { "Asia/Pyongyang" , 0x01E413 },
+ { "Asia/Qatar" , 0x01E498 },
+ { "Asia/Qyzylorda" , 0x01E4FE },
+ { "Asia/Rangoon" , 0x01E6D4 },
+ { "Asia/Riyadh" , 0x01E74C },
+ { "Asia/Saigon" , 0x01E7A1 },
+ { "Asia/Sakhalin" , 0x01E843 },
+ { "Asia/Samarkand" , 0x01EA40 },
+ { "Asia/Seoul" , 0x01EB76 },
+ { "Asia/Shanghai" , 0x01EC69 },
+ { "Asia/Singapore" , 0x01ED15 },
+ { "Asia/Srednekolymsk" , 0x01EDCC },
+ { "Asia/Taipei" , 0x01EFCC },
+ { "Asia/Tashkent" , 0x01F0FD },
+ { "Asia/Tbilisi" , 0x01F22E },
+ { "Asia/Tehran" , 0x01F3E8 },
+ { "Asia/Tel_Aviv" , 0x01F656 },
+ { "Asia/Thimbu" , 0x01F985 },
+ { "Asia/Thimphu" , 0x01F9EB },
+ { "Asia/Tokyo" , 0x01FA51 },
+ { "Asia/Ujung_Pandang" , 0x01FADB },
+ { "Asia/Ulaanbaatar" , 0x01FB58 },
+ { "Asia/Ulan_Bator" , 0x01FCB3 },
+ { "Asia/Urumqi" , 0x01FE00 },
+ { "Asia/Ust-Nera" , 0x01FE62 },
+ { "Asia/Vientiane" , 0x020074 },
+ { "Asia/Vladivostok" , 0x0200C9 },
+ { "Asia/Yakutsk" , 0x0202B3 },
+ { "Asia/Yekaterinburg" , 0x02049D },
+ { "Asia/Yerevan" , 0x0206BE },
+ { "Atlantic/Azores" , 0x0208BE },
+ { "Atlantic/Bermuda" , 0x020DC1 },
+ { "Atlantic/Canary" , 0x0210A2 },
+ { "Atlantic/Cape_Verde" , 0x021378 },
+ { "Atlantic/Faeroe" , 0x0213F1 },
+ { "Atlantic/Faroe" , 0x021695 },
+ { "Atlantic/Jan_Mayen" , 0x021939 },
+ { "Atlantic/Madeira" , 0x021C6B },
+ { "Atlantic/Reykjavik" , 0x022174 },
+ { "Atlantic/South_Georgia" , 0x02232D },
+ { "Atlantic/St_Helena" , 0x02253F },
+ { "Atlantic/Stanley" , 0x022371 },
+ { "Australia/ACT" , 0x022594 },
+ { "Australia/Adelaide" , 0x0228B7 },
+ { "Australia/Brisbane" , 0x022BE9 },
+ { "Australia/Broken_Hill" , 0x022CB6 },
+ { "Australia/Canberra" , 0x022FFA },
+ { "Australia/Currie" , 0x02331D },
+ { "Australia/Darwin" , 0x023656 },
+ { "Australia/Eucla" , 0x0236E2 },
+ { "Australia/Hobart" , 0x0237BE },
+ { "Australia/LHI" , 0x023B22 },
+ { "Australia/Lindeman" , 0x023DC3 },
+ { "Australia/Lord_Howe" , 0x023EAA },
+ { "Australia/Melbourne" , 0x02415B },
+ { "Australia/North" , 0x024486 },
+ { "Australia/NSW" , 0x024500 },
+ { "Australia/Perth" , 0x024823 },
+ { "Australia/Queensland" , 0x024901 },
+ { "Australia/South" , 0x0249B3 },
+ { "Australia/Sydney" , 0x024CD6 },
+ { "Australia/Tasmania" , 0x025019 },
+ { "Australia/Victoria" , 0x025364 },
+ { "Australia/West" , 0x025687 },
+ { "Australia/Yancowinna" , 0x025743 },
+ { "Brazil/Acre" , 0x025A6B },
+ { "Brazil/DeNoronha" , 0x025B6F },
+ { "Brazil/East" , 0x025C8F },
+ { "Brazil/West" , 0x025F6C },
+ { "Canada/Atlantic" , 0x026064 },
+ { "Canada/Central" , 0x02654C },
+ { "Canada/East-Saskatchewan" , 0x026E56 },
+ { "Canada/Eastern" , 0x026966 },
+ { "Canada/Mountain" , 0x026FDF },
+ { "Canada/Newfoundland" , 0x027355 },
+ { "Canada/Pacific" , 0x027880 },
+ { "Canada/Saskatchewan" , 0x027C99 },
+ { "Canada/Yukon" , 0x027E22 },
+ { "CET" , 0x028125 },
+ { "Chile/Continental" , 0x02842E },
+ { "Chile/EasterIsland" , 0x0287C9 },
+ { "CST6CDT" , 0x028B0B },
+ { "Cuba" , 0x028E5C },
+ { "EET" , 0x0291CF },
+ { "Egypt" , 0x029482 },
+ { "Eire" , 0x029869 },
+ { "EST" , 0x029D7A },
+ { "EST5EDT" , 0x029DBE },
+ { "Etc/GMT" , 0x02A10F },
+ { "Etc/GMT+0" , 0x02A1DB },
+ { "Etc/GMT+1" , 0x02A265 },
+ { "Etc/GMT+10" , 0x02A2F2 },
+ { "Etc/GMT+11" , 0x02A380 },
+ { "Etc/GMT+12" , 0x02A40E },
+ { "Etc/GMT+2" , 0x02A529 },
+ { "Etc/GMT+3" , 0x02A5B5 },
+ { "Etc/GMT+4" , 0x02A641 },
+ { "Etc/GMT+5" , 0x02A6CD },
+ { "Etc/GMT+6" , 0x02A759 },
+ { "Etc/GMT+7" , 0x02A7E5 },
+ { "Etc/GMT+8" , 0x02A871 },
+ { "Etc/GMT+9" , 0x02A8FD },
+ { "Etc/GMT-0" , 0x02A197 },
+ { "Etc/GMT-1" , 0x02A21F },
+ { "Etc/GMT-10" , 0x02A2AB },
+ { "Etc/GMT-11" , 0x02A339 },
+ { "Etc/GMT-12" , 0x02A3C7 },
+ { "Etc/GMT-13" , 0x02A455 },
+ { "Etc/GMT-14" , 0x02A49C },
+ { "Etc/GMT-2" , 0x02A4E3 },
+ { "Etc/GMT-3" , 0x02A56F },
+ { "Etc/GMT-4" , 0x02A5FB },
+ { "Etc/GMT-5" , 0x02A687 },
+ { "Etc/GMT-6" , 0x02A713 },
+ { "Etc/GMT-7" , 0x02A79F },
+ { "Etc/GMT-8" , 0x02A82B },
+ { "Etc/GMT-9" , 0x02A8B7 },
+ { "Etc/GMT0" , 0x02A153 },
+ { "Etc/Greenwich" , 0x02A943 },
+ { "Etc/UCT" , 0x02A987 },
+ { "Etc/Universal" , 0x02A9CB },
+ { "Etc/UTC" , 0x02AA0F },
+ { "Etc/Zulu" , 0x02AA53 },
+ { "Europe/Amsterdam" , 0x02AA97 },
+ { "Europe/Andorra" , 0x02AED5 },
+ { "Europe/Athens" , 0x02B151 },
+ { "Europe/Belfast" , 0x02B494 },
+ { "Europe/Belgrade" , 0x02B9CB },
+ { "Europe/Berlin" , 0x02BC94 },
+ { "Europe/Bratislava" , 0x02BFF8 },
+ { "Europe/Brussels" , 0x02C32A },
+ { "Europe/Bucharest" , 0x02C761 },
+ { "Europe/Budapest" , 0x02CA8B },
+ { "Europe/Busingen" , 0x02CDF4 },
+ { "Europe/Chisinau" , 0x02D0AB },
+ { "Europe/Copenhagen" , 0x02D439 },
+ { "Europe/Dublin" , 0x02D743 },
+ { "Europe/Gibraltar" , 0x02DC54 },
+ { "Europe/Guernsey" , 0x02E0AB },
+ { "Europe/Helsinki" , 0x02E5E2 },
+ { "Europe/Isle_of_Man" , 0x02E898 },
+ { "Europe/Istanbul" , 0x02EDCF },
+ { "Europe/Jersey" , 0x02F1BC },
+ { "Europe/Kaliningrad" , 0x02F6F3 },
+ { "Europe/Kiev" , 0x02F95E },
+ { "Europe/Lisbon" , 0x02FC7A },
+ { "Europe/Ljubljana" , 0x03017E },
+ { "Europe/London" , 0x030447 },
+ { "Europe/Luxembourg" , 0x03097E },
+ { "Europe/Madrid" , 0x030DD4 },
+ { "Europe/Malta" , 0x03119A },
+ { "Europe/Mariehamn" , 0x031553 },
+ { "Europe/Minsk" , 0x031809 },
+ { "Europe/Monaco" , 0x031A1C },
+ { "Europe/Moscow" , 0x031E57 },
+ { "Europe/Nicosia" , 0x0320B1 },
+ { "Europe/Oslo" , 0x032399 },
+ { "Europe/Paris" , 0x0326CB },
+ { "Europe/Podgorica" , 0x032B11 },
+ { "Europe/Prague" , 0x032DDA },
+ { "Europe/Riga" , 0x03310C },
+ { "Europe/Rome" , 0x033451 },
+ { "Europe/Samara" , 0x033814 },
+ { "Europe/San_Marino" , 0x033A7D },
+ { "Europe/Sarajevo" , 0x033E40 },
+ { "Europe/Simferopol" , 0x034109 },
+ { "Europe/Skopje" , 0x03435A },
+ { "Europe/Sofia" , 0x034623 },
+ { "Europe/Stockholm" , 0x03492B },
+ { "Europe/Tallinn" , 0x034BDA },
+ { "Europe/Tirane" , 0x034F14 },
+ { "Europe/Tiraspol" , 0x03521A },
+ { "Europe/Uzhgorod" , 0x0355A8 },
+ { "Europe/Vaduz" , 0x0358BF },
+ { "Europe/Vatican" , 0x035B6E },
+ { "Europe/Vienna" , 0x035F31 },
+ { "Europe/Vilnius" , 0x03625E },
+ { "Europe/Volgograd" , 0x03659D },
+ { "Europe/Warsaw" , 0x0367BE },
+ { "Europe/Zagreb" , 0x036B9F },
+ { "Europe/Zaporozhye" , 0x036E68 },
+ { "Europe/Zurich" , 0x0371A9 },
+ { "Factory" , 0x037458 },
+ { "GB" , 0x0374C9 },
+ { "GB-Eire" , 0x037A00 },
+ { "GMT" , 0x037F37 },
+ { "GMT+0" , 0x038003 },
+ { "GMT-0" , 0x037FBF },
+ { "GMT0" , 0x037F7B },
+ { "Greenwich" , 0x038047 },
+ { "Hongkong" , 0x03808B },
+ { "HST" , 0x03824D },
+ { "Iceland" , 0x038291 },
+ { "Indian/Antananarivo" , 0x03844A },
+ { "Indian/Chagos" , 0x0384C9 },
+ { "Indian/Christmas" , 0x03852B },
+ { "Indian/Cocos" , 0x03856F },
+ { "Indian/Comoro" , 0x0385B3 },
+ { "Indian/Kerguelen" , 0x038632 },
+ { "Indian/Mahe" , 0x038687 },
+ { "Indian/Maldives" , 0x0386DC },
+ { "Indian/Mauritius" , 0x038731 },
+ { "Indian/Mayotte" , 0x0387A7 },
+ { "Indian/Reunion" , 0x038826 },
+ { "Iran" , 0x03887B },
+ { "Israel" , 0x038AE9 },
+ { "Jamaica" , 0x038E18 },
+ { "Japan" , 0x038EDD },
+ { "Kwajalein" , 0x038F67 },
+ { "Libya" , 0x038FCA },
+ { "MET" , 0x0390D3 },
+ { "Mexico/BajaNorte" , 0x0393DC },
+ { "Mexico/BajaSur" , 0x039745 },
+ { "Mexico/General" , 0x03998A },
+ { "MST" , 0x039BE8 },
+ { "MST7MDT" , 0x039C2C },
+ { "Navajo" , 0x039F7D },
+ { "NZ" , 0x03A2F6 },
+ { "NZ-CHAT" , 0x03A674 },
+ { "Pacific/Apia" , 0x03A958 },
+ { "Pacific/Auckland" , 0x03AAF4 },
+ { "Pacific/Bougainville" , 0x03AE80 },
+ { "Pacific/Chatham" , 0x03AEF7 },
+ { "Pacific/Chuuk" , 0x03B1EA },
+ { "Pacific/Easter" , 0x03B243 },
+ { "Pacific/Efate" , 0x03B592 },
+ { "Pacific/Enderbury" , 0x03B658 },
+ { "Pacific/Fakaofo" , 0x03B6C6 },
+ { "Pacific/Fiji" , 0x03B717 },
+ { "Pacific/Funafuti" , 0x03B8AA },
+ { "Pacific/Galapagos" , 0x03B8EE },
+ { "Pacific/Gambier" , 0x03B966 },
+ { "Pacific/Guadalcanal" , 0x03B9CB },
+ { "Pacific/Guam" , 0x03BA20 },
+ { "Pacific/Honolulu" , 0x03BA76 },
+ { "Pacific/Johnston" , 0x03BAED },
+ { "Pacific/Kiritimati" , 0x03BB6C },
+ { "Pacific/Kosrae" , 0x03BBD7 },
+ { "Pacific/Kwajalein" , 0x03BC34 },
+ { "Pacific/Majuro" , 0x03BCA0 },
+ { "Pacific/Marquesas" , 0x03BCFF },
+ { "Pacific/Midway" , 0x03BD66 },
+ { "Pacific/Nauru" , 0x03BDF0 },
+ { "Pacific/Niue" , 0x03BE68 },
+ { "Pacific/Norfolk" , 0x03BEC6 },
+ { "Pacific/Noumea" , 0x03BF1B },
+ { "Pacific/Pago_Pago" , 0x03BFAB },
+ { "Pacific/Palau" , 0x03C022 },
+ { "Pacific/Pitcairn" , 0x03C066 },
+ { "Pacific/Pohnpei" , 0x03C0BB },
+ { "Pacific/Ponape" , 0x03C110 },
+ { "Pacific/Port_Moresby" , 0x03C155 },
+ { "Pacific/Rarotonga" , 0x03C1A7 },
+ { "Pacific/Saipan" , 0x03C283 },
+ { "Pacific/Samoa" , 0x03C2E6 },
+ { "Pacific/Tahiti" , 0x03C35D },
+ { "Pacific/Tarawa" , 0x03C3C2 },
+ { "Pacific/Tongatapu" , 0x03C416 },
+ { "Pacific/Truk" , 0x03C4A2 },
+ { "Pacific/Wake" , 0x03C4E7 },
+ { "Pacific/Wallis" , 0x03C537 },
+ { "Pacific/Yap" , 0x03C57B },
+ { "Poland" , 0x03C5C0 },
+ { "Portugal" , 0x03C9A1 },
+ { "PRC" , 0x03CE9D },
+ { "PST8PDT" , 0x03CF3D },
+ { "ROC" , 0x03D28E },
+ { "ROK" , 0x03D3BF },
+ { "Singapore" , 0x03D4B2 },
+ { "Turkey" , 0x03D569 },
+ { "UCT" , 0x03D956 },
+ { "Universal" , 0x03D99A },
+ { "US/Alaska" , 0x03D9DE },
+ { "US/Aleutian" , 0x03DD47 },
+ { "US/Arizona" , 0x03E0AD },
+ { "US/Central" , 0x03E13B },
+ { "US/East-Indiana" , 0x03EB45 },
+ { "US/Eastern" , 0x03E646 },
+ { "US/Hawaii" , 0x03EDAF },
+ { "US/Indiana-Starke" , 0x03EE20 },
+ { "US/Michigan" , 0x03F191 },
+ { "US/Mountain" , 0x03F4C8 },
+ { "US/Pacific" , 0x03F841 },
+ { "US/Pacific-New" , 0x03FC46 },
+ { "US/Samoa" , 0x04004B },
+ { "UTC" , 0x0400C2 },
+ { "W-SU" , 0x0403B9 },
+ { "WET" , 0x040106 },
+ { "Zulu" , 0x0405FC },
};
/* This is a generated file, do not modify */
-const unsigned char timelib_timezone_db_data_builtin[263191] = {
+const unsigned char timelib_timezone_db_data_builtin[263744] = {
/* Africa/Abidjan */
@@ -619,11 +620,13 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Africa/Addis_Ababa */
0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98,
-0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D,
-0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x1C, 0xE5, 0x01, 0x4D,
-0xB5, 0xB0, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x97, 0x1C, 0xE5, 0x01, 0x4D, 0xB5, 0xB0, 0x00, 0x00, 0x00, 0x00,
/* Africa/Algiers */
0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -648,19 +651,23 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Africa/Asmara */
0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98,
-0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D,
-0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0xB9, 0xD5, 0x01, 0x4D,
-0xFD, 0x4D, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xA0, 0xB9, 0xD5, 0x01, 0x4D, 0xFD, 0x4D, 0x00, 0x00, 0x00, 0x00,
/* Africa/Asmera */
0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xC0, 0xAF, 0xF2, 0x98,
-0x01, 0x00, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x05, 0x41, 0x44, 0x4D,
-0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12,
-0xA8, 0x80, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00,
/* Africa/Bamako */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x4C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -894,20 +901,23 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Africa/Dar_es_Salaam */
0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0E, 0xB6, 0xA3, 0xD3, 0xAC,
-0xD6, 0x9D, 0x7F, 0xD0, 0xEF, 0x12, 0x66, 0xD4, 0x01, 0x02, 0x01, 0x00, 0x00, 0x24, 0xD4, 0x00,
-0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x08, 0x4C, 0x4D, 0x54,
-0x00, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x7E, 0xF4, 0x00, 0x01, 0x4E, 0x99, 0x8D, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x7E, 0xF4, 0x00, 0x01, 0x4E, 0x99, 0x8D, 0x00, 0x00, 0x00, 0x00,
/* Africa/Djibouti */
0x50, 0x48, 0x50, 0x31, 0x01, 0x44, 0x4A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD2, 0x0C,
-0x01, 0x00, 0x00, 0x28, 0x74, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
-0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9B, 0x07, 0x80, 0x01, 0x54, 0x7F,
-0xF8, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x9B, 0x07, 0x80, 0x01, 0x54, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00,
/* Africa/Douala */
0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -1010,9 +1020,9 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Africa/Kampala */
0x50, 0x48, 0x50, 0x31, 0x01, 0x55, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDF, 0x1C,
-0xB4, 0xC2, 0x9A, 0xD0, 0xD6, 0x9D, 0x86, 0xD8, 0xE7, 0x8C, 0x47, 0x54, 0x01, 0x02, 0x03, 0x01,
-0x00, 0x00, 0x1E, 0x64, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x89, 0xCF, 0xF2, 0x01, 0x44, 0x1F, 0x42, 0x00, 0x00, 0x00, 0x00,
@@ -1139,11 +1149,13 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Africa/Mogadishu */
0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0xB6, 0xA3, 0xCE, 0x50,
-0xE7, 0x8C, 0x4A, 0xD8, 0x01, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x00, 0x00, 0x00, 0x23, 0x28,
-0x00, 0x04, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x8C, 0x7B, 0x8A, 0x01, 0x57, 0xE1, 0xDA, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x8C, 0x7B, 0x8A, 0x01, 0x57, 0xE1, 0xDA, 0x00, 0x00, 0x00, 0x00,
/* Africa/Monrovia */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -3305,7 +3317,7 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* America/Grand_Turk */
0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x93, 0x0F, 0xB4, 0xFF,
+0x00, 0x00, 0x00, 0x4B, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x93, 0x0F, 0xB4, 0xFF,
0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0, 0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0,
0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0, 0x17, 0x29, 0x0B, 0xF0, 0x18, 0x22, 0x29, 0x60,
0x19, 0x08, 0xED, 0xF0, 0x1A, 0x02, 0x0B, 0x60, 0x1A, 0xF2, 0x0A, 0x70, 0x1B, 0xE1, 0xED, 0x60,
@@ -3324,15 +3336,15 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
0x49, 0xB3, 0x6C, 0xF0, 0x4A, 0xED, 0x23, 0xE0, 0x4B, 0x9C, 0x89, 0x70, 0x4C, 0xD6, 0x40, 0x60,
0x4D, 0x7C, 0x6B, 0x70, 0x4E, 0xB6, 0x22, 0x60, 0x4F, 0x5C, 0x4D, 0x70, 0x50, 0x96, 0x04, 0x60,
0x51, 0x3C, 0x2F, 0x70, 0x52, 0x75, 0xE6, 0x60, 0x53, 0x1C, 0x11, 0x70, 0x54, 0x55, 0xC8, 0x60,
+0x54, 0xFB, 0xF3, 0x70, 0x56, 0x35, 0xAA, 0x60, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02,
-0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x03, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF,
-0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF, 0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x00,
-0x0C, 0x4B, 0x4D, 0x54, 0x00, 0x45, 0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E,
-0x0A, 0x00, 0x00, 0x00, 0x00,
+0x01, 0x02, 0x03, 0xFF, 0xFF, 0xB8, 0x01, 0x00, 0x00, 0xFF, 0xFF, 0xB9, 0xB0, 0x00, 0x04, 0xFF,
+0xFF, 0xC7, 0xC0, 0x01, 0x08, 0xFF, 0xFF, 0xC7, 0xC0, 0x00, 0x0C, 0x4B, 0x4D, 0x54, 0x00, 0x45,
+0x53, 0x54, 0x00, 0x45, 0x44, 0x54, 0x00, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0xAA, 0x15, 0xAA, 0x00, 0xA6, 0x1E, 0x0A, 0x00, 0x00, 0x00, 0x00,
/* America/Grenada */
0x50, 0x48, 0x50, 0x31, 0x01, 0x47, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -8304,13 +8316,16 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Asia/Ho_Chi_Minh */
0x50, 0x48, 0x50, 0x31, 0x01, 0x56, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x42, 0x80,
-0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02,
-0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70,
-0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00,
-0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0xBB, 0x78,
-0x01, 0xB5, 0x6B, 0x2A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x88, 0x8C, 0x43, 0x80,
+0x91, 0xA3, 0x2B, 0x0A, 0xCD, 0x35, 0xE6, 0x80, 0xD1, 0x59, 0xCE, 0x70, 0xD2, 0x3B, 0x3E, 0xF0,
+0xD5, 0x32, 0xBB, 0x10, 0xE4, 0xB6, 0xE4, 0x80, 0xED, 0x2F, 0x98, 0x00, 0x0A, 0x3D, 0xC7, 0x00,
+0x01, 0x02, 0x03, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x63, 0xF6, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00,
+0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x4C, 0x4D, 0x54, 0x00,
+0x49, 0x43, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0xBB, 0x78, 0x01, 0xB5, 0x6B, 0x2A, 0x00, 0x00,
+0x00, 0x00,
/* Asia/Hong_Kong */
0x50, 0x48, 0x50, 0x31, 0x01, 0x48, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9046,13 +9061,11 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Asia/Phnom_Penh */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x44, 0x24,
-0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02,
-0x00, 0x00, 0x62, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70,
-0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00,
-0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xF3, 0xF8,
-0x01, 0xB2, 0xBF, 0x92, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA2, 0x6A, 0x67, 0xC4,
+0x01, 0x00, 0x00, 0x5E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x42, 0x4D, 0x54,
+0x00, 0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9A, 0xF3, 0xF8, 0x01, 0xB2, 0xBF,
+0x92, 0x00, 0x00, 0x00, 0x00,
/* Asia/Pontianak */
0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9072,14 +9085,13 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Asia/Pyongyang */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0D, 0x85, 0x93, 0x7E, 0x78,
-0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x2F, 0x61, 0x70,
-0xE2, 0x4F, 0x29, 0xF0, 0xF0, 0x35, 0x78, 0x80, 0x01, 0x00, 0x01, 0x02, 0x03, 0x04, 0x03, 0x00,
-0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00,
-0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x4B, 0x53, 0x54,
-0x00, 0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xDD, 0x22, 0x01, 0xD2, 0x89, 0x98, 0x00, 0x00, 0x00, 0x00,
-
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x11, 0x8B, 0xD7, 0xF1, 0x9C,
+0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x2F, 0x61, 0x70, 0x01, 0x02, 0x03, 0x04,
+0x00, 0x00, 0x75, 0xE4, 0x00, 0x00, 0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90,
+0x00, 0x08, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x4C, 0x4D,
+0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xDD, 0x22, 0x01, 0xD2, 0x89,
+0x98, 0x00, 0x00, 0x00, 0x00,
/* Asia/Qatar */
0x50, 0x48, 0x50, 0x31, 0x01, 0x51, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9142,13 +9154,16 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Asia/Saigon */
0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x42, 0x80,
-0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02,
-0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70,
-0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00,
-0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40,
-0x01, 0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x15, 0x88, 0x8C, 0x43, 0x80,
+0x91, 0xA3, 0x2B, 0x0A, 0xCD, 0x35, 0xE6, 0x80, 0xD1, 0x59, 0xCE, 0x70, 0xD2, 0x3B, 0x3E, 0xF0,
+0xD5, 0x32, 0xBB, 0x10, 0xE4, 0xB6, 0xE4, 0x80, 0xED, 0x2F, 0x98, 0x00, 0x0A, 0x3D, 0xC7, 0x00,
+0x01, 0x02, 0x03, 0x04, 0x02, 0x03, 0x02, 0x03, 0x02, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x63, 0xF6, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x09, 0x00, 0x00, 0x70, 0x80, 0x00,
+0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x50, 0x4C, 0x4D, 0x54, 0x00,
+0x49, 0x43, 0x54, 0x00, 0x49, 0x44, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00, 0x00,
+0x00, 0x00,
/* Asia/Sakhalin */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9209,17 +9224,20 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Asia/Seoul */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x85, 0x93, 0x7E, 0x78,
-0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0,
-0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, 0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80,
-0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, 0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70,
-0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x02, 0x03, 0x05, 0x04, 0x05, 0x00, 0x03, 0x06, 0x03,
-0x06, 0x03, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00,
-0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D,
-0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0D, 0x4B, 0x53, 0x54, 0x00,
-0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xA0, 0x38, 0x01,
-0xD4, 0x64, 0xDA, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x8B, 0xD7, 0xF0, 0x78,
+0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, 0xE2, 0x4F, 0x29, 0xF0,
+0xE4, 0x6B, 0xB7, 0xF8, 0xE5, 0x13, 0x18, 0x68, 0xE6, 0x62, 0x03, 0x78, 0xE7, 0x11, 0x4C, 0xE8,
+0xE8, 0x2F, 0x70, 0x78, 0xE8, 0xE7, 0xF4, 0x68, 0xEA, 0x0F, 0x52, 0x78, 0xEA, 0xC7, 0xD6, 0x68,
+0xEB, 0xEF, 0x34, 0x78, 0xEC, 0xA7, 0xB8, 0x68, 0xED, 0xCF, 0x16, 0x78, 0xEE, 0x87, 0x9A, 0x68,
+0xF0, 0x35, 0x71, 0x78, 0x20, 0xA3, 0x60, 0x90, 0x21, 0x6E, 0x67, 0x90, 0x22, 0x83, 0x42, 0x90,
+0x23, 0x4E, 0x49, 0x90, 0x01, 0x02, 0x03, 0x04, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05,
+0x01, 0x05, 0x01, 0x05, 0x01, 0x04, 0x06, 0x04, 0x06, 0x04, 0x00, 0x00, 0x77, 0x08, 0x00, 0x00,
+0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90,
+0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x01, 0x11, 0x00, 0x00,
+0x8C, 0xA0, 0x01, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54,
+0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xA0, 0x38, 0x01, 0xD4, 0x64, 0xDA, 0x00,
+0x00, 0x00, 0x00,
/* Asia/Shanghai */
0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -9584,13 +9602,11 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Asia/Vientiane */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0C, 0x88, 0x6F, 0x46, 0x50,
-0x91, 0x5F, 0xEE, 0xD0, 0x93, 0x85, 0xB1, 0x90, 0xB7, 0x41, 0xBC, 0x00, 0x01, 0x02, 0x03, 0x02,
-0x00, 0x00, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x63, 0xEC, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70,
-0x00, 0x08, 0x00, 0x00, 0x70, 0x80, 0x00, 0x08, 0x4C, 0x4D, 0x54, 0x00, 0x53, 0x4D, 0x54, 0x00,
-0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xBE, 0x7A,
-0x01, 0xAF, 0x36, 0xA0, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xA2, 0x6A, 0x67, 0xC4,
+0x01, 0x00, 0x00, 0x5E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x42, 0x4D, 0x54,
+0x00, 0x49, 0x43, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA4, 0xBE, 0x7A, 0x01, 0xAF, 0x36,
+0xA0, 0x00, 0x00, 0x00, 0x00,
/* Asia/Vladivostok */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -14391,7 +14407,7 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Europe/Minsk */
0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x22, 0xAA, 0x19, 0xAA, 0x38,
+0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x22, 0xAA, 0x19, 0xAA, 0x38,
0xB5, 0xA4, 0x19, 0x60, 0xCA, 0x5E, 0x70, 0xD0, 0xCC, 0xE7, 0x4B, 0x10, 0xCD, 0xA9, 0x17, 0x90,
0xCE, 0xA2, 0x43, 0x10, 0xCF, 0x92, 0x34, 0x10, 0xD0, 0x0A, 0x02, 0x60, 0x15, 0x27, 0xA7, 0xD0,
0x16, 0x18, 0xDC, 0x40, 0x17, 0x08, 0xDB, 0x50, 0x17, 0xFA, 0x0F, 0xC0, 0x18, 0xEA, 0x0E, 0xD0,
@@ -14408,20 +14424,21 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
0x40, 0x66, 0x15, 0x80, 0x41, 0x84, 0x2B, 0x00, 0x42, 0x45, 0xF7, 0x80, 0x43, 0x64, 0x0D, 0x00,
0x44, 0x25, 0xD9, 0x80, 0x45, 0x43, 0xEF, 0x00, 0x46, 0x05, 0xBB, 0x80, 0x47, 0x23, 0xD1, 0x00,
0x47, 0xEE, 0xD8, 0x00, 0x49, 0x03, 0xB3, 0x00, 0x49, 0xCE, 0xBA, 0x00, 0x4A, 0xE3, 0x95, 0x00,
-0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, 0x01, 0x02, 0x05, 0x03,
-0x04, 0x03, 0x04, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07, 0x08, 0x07, 0x08, 0x07,
-0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x02, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x4B, 0xAE, 0x9C, 0x00, 0x4C, 0xCC, 0xB1, 0x80, 0x4D, 0x8E, 0x7E, 0x00, 0x54, 0x4C, 0x1D, 0x60,
+0x01, 0x02, 0x05, 0x03, 0x04, 0x03, 0x04, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x07,
+0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x08, 0x07, 0x02, 0x09, 0x0A, 0x09, 0x0A, 0x09,
+0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09,
-0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x09, 0x0A, 0x0B,
-0x00, 0x00, 0x19, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30,
-0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00,
-0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08,
-0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x19, 0x00, 0x00, 0x1C, 0x20,
-0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x4D, 0x4D, 0x54, 0x00, 0x45, 0x45, 0x54, 0x00,
-0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53, 0x54, 0x00, 0x4D, 0x53, 0x44,
-0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x46, 0x45, 0x54, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
-0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0xDB, 0x92, 0xF0, 0x01, 0x3C, 0xB8, 0xBA, 0x00, 0x00, 0x00, 0x00,
+0x0A, 0x09, 0x0A, 0x0B, 0x07, 0x00, 0x00, 0x19, 0xC8, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00,
+0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x0E, 0x10, 0x00, 0x0C, 0x00, 0x00, 0x1C,
+0x20, 0x01, 0x10, 0x00, 0x00, 0x1C, 0x20, 0x01, 0x10, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00,
+0x00, 0x2A, 0x30, 0x00, 0x08, 0x00, 0x00, 0x38, 0x40, 0x01, 0x15, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x19, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x1E, 0x4D, 0x4D, 0x54,
+0x00, 0x45, 0x45, 0x54, 0x00, 0x4D, 0x53, 0x4B, 0x00, 0x43, 0x45, 0x54, 0x00, 0x43, 0x45, 0x53,
+0x54, 0x00, 0x4D, 0x53, 0x44, 0x00, 0x45, 0x45, 0x53, 0x54, 0x00, 0x46, 0x45, 0x54, 0x00, 0x00,
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDB, 0x92, 0xF0, 0x01, 0x3C, 0xB8, 0xBA, 0x00,
+0x00, 0x00, 0x00,
/* Europe/Monaco */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -16228,12 +16245,12 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Indian/Antananarivo */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0D, 0x91, 0xF3, 0xCD, 0xF4,
-0xE2, 0x33, 0xC0, 0xC0, 0xE2, 0xAB, 0xB9, 0x40, 0x01, 0x02, 0x03, 0x00, 0x00, 0x2C, 0x8C, 0x00,
-0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x38, 0x40, 0x01, 0x08, 0x00, 0x00, 0x2A,
-0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00, 0x45, 0x41, 0x53, 0x54, 0x00,
-0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C, 0x76, 0xED, 0x01, 0x5B, 0x29, 0xB2,
-0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x6C, 0x76, 0xED, 0x01, 0x5B, 0x29, 0xB2, 0x00, 0x00, 0x00, 0x00,
/* Indian/Chagos */
0x50, 0x48, 0x50, 0x31, 0x01, 0x49, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -16260,11 +16277,13 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Indian/Comoro */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4B, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD1, 0xF0,
-0x01, 0x00, 0x00, 0x28, 0x90, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
-0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x80, 0x72, 0x01, 0x54, 0xAD,
-0x8A, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x77, 0x80, 0x72, 0x01, 0x54, 0xAD, 0x8A, 0x00, 0x00, 0x00, 0x00,
/* Indian/Kerguelen */
0x50, 0x48, 0x50, 0x31, 0x01, 0x54, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -16302,11 +16321,13 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Indian/Mayotte */
0x50, 0x48, 0x50, 0x31, 0x01, 0x59, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x91, 0xF3, 0xD0, 0x18,
-0x01, 0x00, 0x00, 0x2A, 0x68, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x4C, 0x4D, 0x54,
-0x00, 0x45, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0xD2, 0xC2, 0x01, 0x57, 0xAD,
-0xC5, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x13, 0xB1, 0xEE, 0xDA, 0xFC,
+0xB4, 0xC2, 0x9A, 0xD0, 0xC7, 0x91, 0x47, 0xD8, 0xED, 0x2F, 0xE1, 0xD4, 0x01, 0x02, 0x03, 0x01,
+0x00, 0x00, 0x22, 0x84, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x00, 0x04, 0x00, 0x00, 0x23, 0x28,
+0x00, 0x08, 0x00, 0x00, 0x26, 0xAC, 0x00, 0x0D, 0x4C, 0x4D, 0x54, 0x00, 0x45, 0x41, 0x54, 0x00,
+0x42, 0x45, 0x41, 0x54, 0x00, 0x42, 0x45, 0x41, 0x55, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x75, 0xD2, 0xC2, 0x01, 0x57, 0xAD, 0xC5, 0x00, 0x00, 0x00, 0x00,
/* Indian/Reunion */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -16966,6 +16987,16 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
0x00, 0x00, 0x00, 0x51, 0x13, 0x35, 0x02, 0x1D, 0x54, 0xBA, 0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F,
0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x73,
+/* Pacific/Bougainville */
+0x50, 0x48, 0x50, 0x31, 0x01, 0x50, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0xCC, 0x43, 0x36, 0x60,
+0xD2, 0x2B, 0x6C, 0xF0, 0x54, 0x9E, 0xD7, 0x80, 0x01, 0x00, 0x02, 0x00, 0x00, 0x8C, 0xA0, 0x00,
+0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x9A, 0xB0, 0x00, 0x08, 0x50, 0x47, 0x54,
+0x00, 0x4A, 0x53, 0x54, 0x00, 0x42, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x7F, 0xD7, 0xDD, 0x02, 0x00, 0x08, 0xBA, 0x00, 0x00, 0x00, 0x0C, 0x42, 0x6F, 0x75, 0x67, 0x61,
+0x69, 0x6E, 0x76, 0x69, 0x6C, 0x6C, 0x65,
+
/* Pacific/Chatham */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4E, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
@@ -17118,19 +17149,19 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
0x36, 0x3B, 0x17, 0xE0, 0x36, 0xD7, 0xFA, 0x60, 0x38, 0x24, 0x34, 0x60, 0x38, 0xB7, 0xDC, 0x60,
0x4B, 0x11, 0x2C, 0xE0, 0x4B, 0xAE, 0x0F, 0x60, 0x4C, 0xC2, 0xEA, 0x60, 0x4D, 0x72, 0x41, 0xE0,
0x4E, 0xA2, 0xCC, 0x60, 0x4F, 0x1A, 0xC4, 0xE0, 0x50, 0x82, 0xAE, 0x60, 0x50, 0xFA, 0xA6, 0xE0,
-0x52, 0x6B, 0xCA, 0xE0, 0x52, 0xDA, 0x7A, 0xD0, 0x54, 0x4B, 0xAC, 0xE0, 0x54, 0xBA, 0x5C, 0xD0,
-0x56, 0x2B, 0x8E, 0xE0, 0x56, 0xA3, 0x79, 0x50, 0x58, 0x0B, 0x70, 0xE0, 0x58, 0x83, 0x5B, 0x50,
-0x59, 0xEB, 0x52, 0xE0, 0x5A, 0x63, 0x3D, 0x50, 0x5B, 0xCB, 0x34, 0xE0, 0x5C, 0x43, 0x1F, 0x50,
-0x5D, 0xB4, 0x51, 0x60, 0x5E, 0x23, 0x01, 0x50, 0x5F, 0x94, 0x33, 0x60, 0x60, 0x0C, 0x1D, 0xD0,
-0x61, 0x74, 0x15, 0x60, 0x61, 0xEB, 0xFF, 0xD0, 0x63, 0x53, 0xF7, 0x60, 0x63, 0xCB, 0xE1, 0xD0,
-0x65, 0x33, 0xD9, 0x60, 0x65, 0xAB, 0xC3, 0xD0, 0x67, 0x1C, 0xF5, 0xE0, 0x67, 0x8B, 0xA5, 0xD0,
-0x68, 0xFC, 0xD7, 0xE0, 0x69, 0x6B, 0x87, 0xD0, 0x6A, 0xDC, 0xB9, 0xE0, 0x6B, 0x54, 0xA4, 0x50,
-0x6C, 0xBC, 0x9B, 0xE0, 0x6D, 0x34, 0x86, 0x50, 0x6E, 0x9C, 0x7D, 0xE0, 0x6F, 0x14, 0x68, 0x50,
-0x70, 0x7C, 0x5F, 0xE0, 0x70, 0xF4, 0x4A, 0x50, 0x72, 0x65, 0x7C, 0x60, 0x72, 0xD4, 0x2C, 0x50,
-0x74, 0x45, 0x5E, 0x60, 0x74, 0xB4, 0x0E, 0x50, 0x76, 0x25, 0x40, 0x60, 0x76, 0x9D, 0x2A, 0xD0,
-0x78, 0x05, 0x22, 0x60, 0x78, 0x7D, 0x0C, 0xD0, 0x79, 0xE5, 0x04, 0x60, 0x7A, 0x5C, 0xEE, 0xD0,
-0x7B, 0xC4, 0xE6, 0x60, 0x7C, 0x3C, 0xD0, 0xD0, 0x7D, 0xAE, 0x02, 0xE0, 0x7E, 0x1C, 0xB2, 0xD0,
-0x7F, 0x8D, 0xE4, 0xE0, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
+0x52, 0x6B, 0xCA, 0xE0, 0x52, 0xDA, 0x7A, 0xD0, 0x54, 0x54, 0xE7, 0x60, 0x54, 0xBA, 0x6A, 0xE0,
+0x56, 0x34, 0xC9, 0x60, 0x56, 0xA3, 0x87, 0x60, 0x58, 0x1D, 0xE5, 0xE0, 0x58, 0x83, 0x69, 0x60,
+0x59, 0xFD, 0xC7, 0xE0, 0x5A, 0x63, 0x4B, 0x60, 0x5B, 0xDD, 0xA9, 0xE0, 0x5C, 0x43, 0x2D, 0x60,
+0x5D, 0xBD, 0x8B, 0xE0, 0x5E, 0x23, 0x0F, 0x60, 0x5F, 0x9D, 0x6D, 0xE0, 0x60, 0x0C, 0x2B, 0xE0,
+0x61, 0x86, 0x8A, 0x60, 0x61, 0xEC, 0x0D, 0xE0, 0x63, 0x66, 0x6C, 0x60, 0x63, 0xCB, 0xEF, 0xE0,
+0x65, 0x46, 0x4E, 0x60, 0x65, 0xAB, 0xD1, 0xE0, 0x67, 0x26, 0x30, 0x60, 0x67, 0x8B, 0xB3, 0xE0,
+0x69, 0x06, 0x12, 0x60, 0x69, 0x6B, 0x95, 0xE0, 0x6A, 0xE5, 0xF4, 0x60, 0x6B, 0x54, 0xB2, 0x60,
+0x6C, 0xCF, 0x10, 0xE0, 0x6D, 0x34, 0x94, 0x60, 0x6E, 0xAE, 0xF2, 0xE0, 0x6F, 0x14, 0x76, 0x60,
+0x70, 0x8E, 0xD4, 0xE0, 0x70, 0xF4, 0x58, 0x60, 0x72, 0x6E, 0xB6, 0xE0, 0x72, 0xD4, 0x3A, 0x60,
+0x74, 0x4E, 0x98, 0xE0, 0x74, 0xB4, 0x1C, 0x60, 0x76, 0x37, 0xB5, 0x60, 0x76, 0x9D, 0x38, 0xE0,
+0x78, 0x17, 0x97, 0x60, 0x78, 0x7D, 0x1A, 0xE0, 0x79, 0xF7, 0x79, 0x60, 0x7A, 0x5C, 0xFC, 0xE0,
+0x7B, 0xD7, 0x5B, 0x60, 0x7C, 0x3C, 0xDE, 0xE0, 0x7D, 0xB7, 0x3D, 0x60, 0x7E, 0x1C, 0xC0, 0xE0,
+0x7F, 0x97, 0x1F, 0x60, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01,
@@ -17338,7 +17369,8 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x8C, 0xA0,
0x00, 0x00, 0x50, 0x47, 0x54, 0x00, 0x00, 0x00, 0x00, 0x7A, 0xD5, 0x50, 0x01, 0xF3, 0x37, 0x7A,
-0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x0E, 0x6D, 0x6F, 0x73, 0x74, 0x20, 0x6C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F,
+0x6E, 0x73,
/* Pacific/Rarotonga */
0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x4B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -17673,17 +17705,20 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* ROK */
0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x11, 0x85, 0x93, 0x7E, 0x78,
-0xB0, 0xFE, 0x8D, 0xF0, 0xB8, 0x84, 0xB4, 0x78, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0,
-0xE2, 0x4F, 0x29, 0xF0, 0xED, 0xE1, 0x92, 0x80, 0xEE, 0x81, 0x09, 0xF0, 0xF0, 0x35, 0x78, 0x80,
-0xFD, 0xA5, 0x0A, 0xF8, 0x20, 0xA3, 0x44, 0x70, 0x21, 0x6E, 0x3D, 0x60, 0x22, 0x83, 0x26, 0x70,
-0x23, 0x4E, 0x1F, 0x60, 0x01, 0x00, 0x01, 0x02, 0x03, 0x05, 0x04, 0x05, 0x00, 0x03, 0x06, 0x03,
-0x06, 0x03, 0x00, 0x00, 0x77, 0x88, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00,
-0x7E, 0x90, 0x00, 0x09, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x90, 0x01, 0x0D,
-0x00, 0x00, 0x70, 0x80, 0x00, 0x00, 0x00, 0x00, 0x8C, 0xA0, 0x01, 0x0D, 0x4B, 0x53, 0x54, 0x00,
-0x4A, 0x43, 0x53, 0x54, 0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01,
-0x12, 0xA8, 0x80, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x15, 0x8B, 0xD7, 0xF0, 0x78,
+0x92, 0xE6, 0x16, 0xF8, 0xC3, 0x55, 0x3B, 0x70, 0xD2, 0x43, 0x27, 0xF0, 0xE2, 0x4F, 0x29, 0xF0,
+0xE4, 0x6B, 0xB7, 0xF8, 0xE5, 0x13, 0x18, 0x68, 0xE6, 0x62, 0x03, 0x78, 0xE7, 0x11, 0x4C, 0xE8,
+0xE8, 0x2F, 0x70, 0x78, 0xE8, 0xE7, 0xF4, 0x68, 0xEA, 0x0F, 0x52, 0x78, 0xEA, 0xC7, 0xD6, 0x68,
+0xEB, 0xEF, 0x34, 0x78, 0xEC, 0xA7, 0xB8, 0x68, 0xED, 0xCF, 0x16, 0x78, 0xEE, 0x87, 0x9A, 0x68,
+0xF0, 0x35, 0x71, 0x78, 0x20, 0xA3, 0x60, 0x90, 0x21, 0x6E, 0x67, 0x90, 0x22, 0x83, 0x42, 0x90,
+0x23, 0x4E, 0x49, 0x90, 0x01, 0x02, 0x03, 0x04, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05, 0x01, 0x05,
+0x01, 0x05, 0x01, 0x05, 0x01, 0x04, 0x06, 0x04, 0x06, 0x04, 0x00, 0x00, 0x77, 0x08, 0x00, 0x00,
+0x00, 0x00, 0x77, 0x88, 0x00, 0x04, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x08, 0x00, 0x00, 0x7E, 0x90,
+0x00, 0x0D, 0x00, 0x00, 0x7E, 0x90, 0x00, 0x04, 0x00, 0x00, 0x85, 0x98, 0x01, 0x11, 0x00, 0x00,
+0x8C, 0xA0, 0x01, 0x11, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x53, 0x54, 0x00, 0x4A, 0x43, 0x53, 0x54,
+0x00, 0x4A, 0x53, 0x54, 0x00, 0x4B, 0x44, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80, 0x00,
+0x00, 0x00, 0x00,
/* Singapore */
0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -18532,4 +18567,4 @@ const unsigned char timelib_timezone_db_data_builtin[263191] = {
0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80,
0x00, 0x00, 0x00, 0x00, };
-const timelib_tzdb timezonedb_builtin = { "2014.8", 582, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
+const timelib_tzdb timezonedb_builtin = { "2014.10", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index f2ced7bd59..6146dec927 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1230,7 +1230,7 @@ static void php_date(INTERNAL_FUNCTION_PARAMETERS, int localtime)
}
/* }}} */
-PHPAPI zend_string *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */
+PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC) /* {{{ */
{
timelib_time *t;
timelib_tzinfo *tzi;
@@ -3031,7 +3031,7 @@ PHP_FUNCTION(date_format)
}
/* }}} */
-static int php_date_modify(zval *object, char *modify, int modify_len TSRMLS_DC) /* {{{ */
+static int php_date_modify(zval *object, char *modify, size_t modify_len TSRMLS_DC) /* {{{ */
{
php_date_obj *dateobj;
timelib_time *tmp_time;
@@ -3938,7 +3938,7 @@ PHP_FUNCTION(timezone_location_get)
}
/* }}} */
-static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, int format_length TSRMLS_DC) /* {{{ */
+static int date_interval_initialize(timelib_rel_time **rt, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */
{
timelib_time *b = NULL, *e = NULL;
timelib_rel_time *p = NULL;
@@ -4221,7 +4221,7 @@ PHP_FUNCTION(date_interval_create_from_date_string)
/* }}} */
/* {{{ date_interval_format - */
-static zend_string *date_interval_format(char *format, int format_len, timelib_rel_time *t TSRMLS_DC)
+static zend_string *date_interval_format(char *format, size_t format_len, timelib_rel_time *t TSRMLS_DC)
{
smart_str string = {0};
int i, length, have_format_spec = 0;
@@ -4302,7 +4302,7 @@ PHP_FUNCTION(date_interval_format)
}
/* }}} */
-static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, int format_length TSRMLS_DC) /* {{{ */
+static int date_period_initialize(timelib_time **st, timelib_time **et, timelib_rel_time **d, zend_long *recurrences, /*const*/ char *format, size_t format_length TSRMLS_DC) /* {{{ */
{
timelib_time *b = NULL, *e = NULL;
timelib_rel_time *p = NULL;
diff --git a/ext/date/php_date.h b/ext/date/php_date.h
index d8f825163a..3a938fe74f 100644
--- a/ext/date/php_date.h
+++ b/ext/date/php_date.h
@@ -210,7 +210,7 @@ PHPAPI int php_idate(char format, time_t ts, int localtime TSRMLS_DC);
#define _php_strftime php_strftime
PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, int gm);
#endif
-PHPAPI zend_string *php_format_date(char *format, int format_len, time_t ts, int localtime TSRMLS_DC);
+PHPAPI zend_string *php_format_date(char *format, size_t format_len, time_t ts, int localtime TSRMLS_DC);
/* Mechanism to set new TZ database */
PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb);
diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch
index 8b0b9a8911..30f1e9b450 100644
--- a/ext/fileinfo/libmagic.patch
+++ b/ext/fileinfo/libmagic.patch
@@ -1,6 +1,6 @@
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c Tue Nov 19 22:01:12 2013
-+++ libmagic/apprentice.c Mon Mar 31 17:15:53 2014
++++ libmagic/apprentice.c Sun Sep 21 18:30:39 2014
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -357,8 +357,9 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
uint32_t i, j;
size_t files = 0, maxfiles = 0;
- char **filearr = NULL, *mfn;
+- struct stat st;
+ char **filearr = NULL;
- struct stat st;
++ zend_stat_t st;
struct magic_map *map;
struct magic_entry_set mset[MAGIC_SETS];
- DIR *dir;
@@ -406,8 +407,9 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+ php_stream_closedir(dir);
goto out;
}
- if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) {
+- if (stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) {
- free(mfn);
++ if (zend_stat(mfn, &st) == -1 || !S_ISREG(st.st_mode)) {
continue;
}
if (files >= maxfiles) {
@@ -454,6 +456,15 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
return map;
+@@ -1248,7 +1272,7 @@
+ * the sign extension must have happened.
+ */
+ case FILE_BYTE:
+- v = (char) v;
++ v = (signed char) v;
+ break;
+ case FILE_SHORT:
+ case FILE_BESHORT:
@@ -1516,7 +1540,7 @@
if (me->cont_count == me->max_count) {
struct magic *nm;
@@ -536,12 +547,12 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
size_t i;
+ php_stream *stream = NULL;
+ php_stream_statbuf st;
-+
-+
-+ TSRMLS_FETCH();
- fd = -1;
- if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
++
++ TSRMLS_FETCH();
++
+ if ((map = CAST(struct magic_map *, ecalloc(1, sizeof(*map)))) == NULL) {
file_oomem(ms, sizeof(*map));
+ efree(map);
@@ -649,7 +660,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+ if (NULL != fn) {
+ nentries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
+ entries = (uint32_t)(st.sb.st_size / sizeof(struct magic));
-+ if ((off_t)(entries * sizeof(struct magic)) != st.sb.st_size) {
++ if ((zend_off_t)(entries * sizeof(struct magic)) != st.sb.st_size) {
+ file_error(ms, 0, "Size of `%s' %llu is not a multiple of %zu",
+ dbname, (unsigned long long)st.sb.st_size,
+ sizeof(struct magic));
@@ -729,7 +740,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
assert(nm + sizeof(ar) < m);
- if (lseek(fd, (off_t)m, SEEK_SET) != (off_t)m) {
-+ if (php_stream_seek(stream,(off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) {
++ if (php_stream_seek(stream,(zend_off_t)sizeof(struct magic), SEEK_SET) != sizeof(struct magic)) {
file_error(ms, errno, "error seeking `%s'", dbname);
goto out;
}
@@ -800,7 +811,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
--- libmagic.orig/ascmagic.c Thu Feb 13 00:20:53 2014
-+++ libmagic/ascmagic.c Fri Feb 21 00:21:27 2014
++++ libmagic/ascmagic.c Wed Aug 27 12:35:45 2014
@@ -139,7 +139,7 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -822,7 +833,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
}
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c Tue Feb 26 17:20:42 2013
-+++ libmagic/cdf.c Tue Jul 1 08:57:25 2014
++++ libmagic/cdf.c Wed Aug 27 12:35:45 2014
@@ -35,7 +35,7 @@
#include "file.h"
@@ -850,7 +861,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
#include <string.h>
#include <time.h>
#include <ctype.h>
-@@ -267,13 +277,15 @@
+@@ -267,23 +277,25 @@
{
const char *b = (const char *)sst->sst_tab;
const char *e = ((const char *)p) + tail;
@@ -868,18 +879,48 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
errno = EFTYPE;
return -1;
}
+
+ static ssize_t
+-cdf_read(const cdf_info_t *info, off_t off, void *buf, size_t len)
++cdf_read(const cdf_info_t *info, zend_off_t off, void *buf, size_t len)
+ {
+ size_t siz = (size_t)off + len;
+
+- if ((off_t)(off + len) != (off_t)siz) {
++ if ((zend_off_t)(off + len) != (zend_off_t)siz) {
+ errno = EINVAL;
+ return -1;
+ }
@@ -296,7 +308,10 @@
if (info->i_fd == -1)
return -1;
- if (pread(info->i_fd, buf, len, off) != (ssize_t)len)
-+ if (FINFO_LSEEK_FUNC(info->i_fd, off, SEEK_SET) == (off_t)-1)
++ if (FINFO_LSEEK_FUNC(info->i_fd, off, SEEK_SET) == (zend_off_t)-1)
+ return -1;
+
+ if (FINFO_READ_FUNC(info->i_fd, buf, len) != (ssize_t)len)
return -1;
return (ssize_t)len;
+@@ -308,7 +323,7 @@
+ char buf[512];
+
+ (void)memcpy(cdf_bo.s, "\01\02\03\04", 4);
+- if (cdf_read(info, (off_t)0, buf, sizeof(buf)) == -1)
++ if (cdf_read(info, (zend_off_t)0, buf, sizeof(buf)) == -1)
+ return -1;
+ cdf_unpack_header(h, buf);
+ cdf_swap_header(h);
+@@ -342,7 +357,7 @@
+ size_t ss = CDF_SEC_SIZE(h);
+ size_t pos = CDF_SEC_POS(h, id);
+ assert(ss == len);
+- return cdf_read(info, (off_t)pos, ((char *)buf) + offs, len);
++ return cdf_read(info, (zend_off_t)pos, ((char *)buf) + offs, len);
+ }
+
+ ssize_t
@@ -352,10 +367,10 @@
size_t ss = CDF_SHORT_SEC_SIZE(h);
size_t pos = CDF_SHORT_SEC_POS(h, id);
@@ -937,7 +978,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
/* If the it is not there, just fake it; some docs don't have it */
if (d->d_stream_first_sector < 0)
-@@ -796,7 +815,11 @@
+@@ -796,11 +815,15 @@
if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
goto out;
for (i = 0; i < sh.sh_properties; i++) {
@@ -950,6 +991,11 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
q = (const uint8_t *)(const void *)
((const char *)(const void *)p + ofs
- 2 * sizeof(uint32_t));
+- if (q > e) {
++ if (q < p || q > e) {
+ DPRINTF(("Ran of the end %p > %p\n", q, e));
+ goto out;
+ }
@@ -810,6 +833,10 @@
i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
if (inp[i].pi_type & CDF_VECTOR) {
@@ -1038,7 +1084,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
} else {
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h Thu Jun 21 00:19:55 2012
-+++ libmagic/cdf.h Thu Jun 5 18:05:33 2014
++++ libmagic/cdf.h Wed Aug 27 12:35:45 2014
@@ -35,10 +35,12 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -1091,7 +1137,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
int cdf_read_summary_info(const cdf_info_t *, const cdf_header_t *,
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c Thu Jun 21 00:18:33 2012
-+++ libmagic/cdf_time.c Fri Feb 21 00:21:27 2014
++++ libmagic/cdf_time.c Wed Aug 27 12:35:45 2014
@@ -96,7 +96,7 @@
}
@@ -1151,7 +1197,7 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
static const char *ref = "Sat Apr 23 01:30:00 1977";
diff -u libmagic.orig/compress.c libmagic/compress.c
--- libmagic.orig/compress.c Sun Jan 5 16:55:21 2014
-+++ libmagic/compress.c Fri Feb 21 00:21:27 2014
++++ libmagic/compress.c Wed Aug 27 12:35:45 2014
@@ -32,6 +32,7 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1237,7 +1283,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
}
(void)close(tfd);
- if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
-+ if (FINFO_LSEEK_FUNC(fd, (off_t)0, SEEK_SET) == (off_t)-1) {
++ if (FINFO_LSEEK_FUNC(fd, (zend_off_t)0, SEEK_SET) == (zend_off_t)-1) {
file_badseek(ms);
return -1;
}
@@ -1266,7 +1312,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
- _exit(1);
- (void) lseek(0, (off_t)0, SEEK_SET);
+ (void) dup(fd);
-+ (void) FINFO_LSEEK_FUNC(0, (off_t)0, SEEK_SET);
++ (void) FINFO_LSEEK_FUNC(0, (zend_off_t)0, SEEK_SET);
} else {
- if (dup(fdin[0]) == -1)
- _exit(1);
@@ -1312,9 +1358,39 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
}
-#endif
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
+diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
+--- libmagic.orig/elfclass.h Mon Feb 18 19:33:14 2013
++++ libmagic/elfclass.h Wed Aug 27 12:35:45 2014
+@@ -37,7 +37,7 @@
+ case ET_CORE:
+ flags |= FLAGS_IS_CORE;
+ if (dophn_core(ms, clazz, swap, fd,
+- (off_t)elf_getu(swap, elfhdr.e_phoff),
++ (zend_off_t)elf_getu(swap, elfhdr.e_phoff),
+ elf_getu16(swap, elfhdr.e_phnum),
+ (size_t)elf_getu16(swap, elfhdr.e_phentsize),
+ fsize, &flags) == -1)
+@@ -47,7 +47,7 @@
+ case ET_EXEC:
+ case ET_DYN:
+ if (dophn_exec(ms, clazz, swap, fd,
+- (off_t)elf_getu(swap, elfhdr.e_phoff),
++ (zend_off_t)elf_getu(swap, elfhdr.e_phoff),
+ elf_getu16(swap, elfhdr.e_phnum),
+ (size_t)elf_getu16(swap, elfhdr.e_phentsize),
+ fsize, &flags, elf_getu16(swap, elfhdr.e_shnum))
+@@ -56,7 +56,7 @@
+ /*FALLTHROUGH*/
+ case ET_REL:
+ if (doshn(ms, clazz, swap, fd,
+- (off_t)elf_getu(swap, elfhdr.e_shoff),
++ (zend_off_t)elf_getu(swap, elfhdr.e_shoff),
+ elf_getu16(swap, elfhdr.e_shnum),
+ (size_t)elf_getu16(swap, elfhdr.e_shentsize),
+ fsize, &flags, elf_getu16(swap, elfhdr.e_machine),
diff -u libmagic.orig/file.h libmagic/file.h
--- libmagic.orig/file.h Thu Feb 13 00:20:53 2014
-+++ libmagic/file.h Fri Feb 21 00:21:27 2014
++++ libmagic/file.h Wed Aug 27 12:35:45 2014
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1383,7 +1459,13 @@ diff -u libmagic.orig/file.h libmagic/file.h
((t) == FILE_STRING || \
(t) == FILE_PSTRING || \
(t) == FILE_BESTRING16 || \
-@@ -411,22 +413,18 @@
+@@ -405,28 +407,23 @@
+ /* Type for Unicode characters */
+ typedef unsigned long unichar;
+
+-struct stat;
+ #define FILE_T_LOCAL 1
+ #define FILE_T_WINDOWS 2
protected const char *file_fmttime(uint64_t, int, char *);
protected struct magic_set *file_ms_alloc(int);
protected void file_ms_free(struct magic_set *);
@@ -1391,7 +1473,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
+protected int file_buffer(struct magic_set *, php_stream *, const char *, const void *,
size_t);
-protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
-+protected int file_fsmagic(struct magic_set *, const char *, struct stat *, php_stream *);
++protected int file_fsmagic(struct magic_set *, const char *, zend_stat_t *, php_stream *);
protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
-protected int file_vprintf(struct magic_set *, const char *, va_list)
- __attribute__((__format__(__printf__, 2, 0)));
@@ -1410,7 +1492,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
protected int file_zmagic(struct magic_set *, int, const char *,
const unsigned char *, size_t);
#endif
-@@ -444,16 +442,13 @@
+@@ -444,16 +441,13 @@
protected int file_magicfind(struct magic_set *, const char *, struct mlist *);
protected uint64_t file_signextend(struct magic_set *, struct magic *,
uint64_t);
@@ -1431,7 +1513,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
protected void file_showstr(FILE *, const char *, size_t);
protected size_t file_mbswidth(const char *);
protected const char *file_getbuffer(struct magic_set *);
-@@ -463,16 +458,14 @@
+@@ -463,16 +457,14 @@
size_t *);
protected size_t file_pstring_length_size(const struct magic *);
protected size_t file_pstring_get_length(const struct magic *, const char *);
@@ -1449,7 +1531,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
#ifndef HAVE_STRERROR
extern int sys_nerr;
-@@ -485,20 +478,10 @@
+@@ -485,20 +477,10 @@
#define strtoul(a, b, c) strtol(a, b, c)
#endif
@@ -1472,7 +1554,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
size_t strlcat(char *, const char *, size_t);
#endif
#ifndef HAVE_STRCASESTR
-@@ -535,6 +518,14 @@
+@@ -535,6 +517,14 @@
#endif
#else
#define FILE_RCSID(id)
@@ -1489,7 +1571,7 @@ diff -u libmagic.orig/file.h libmagic/file.h
#endif /* __file_h__ */
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
--- libmagic.orig/fsmagic.c Sun Dec 1 20:22:13 2013
-+++ libmagic/fsmagic.c Fri Feb 21 00:21:27 2014
++++ libmagic/fsmagic.c Wed Aug 27 12:35:45 2014
@@ -59,27 +59,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1537,7 +1619,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
protected int
-file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
-+file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb, php_stream *stream)
++file_fsmagic(struct magic_set *ms, const char *fn, zend_stat_t *sb, php_stream *stream)
{
int ret, did = 0;
int mime = ms->flags & MAGIC_MIME;
@@ -1814,7 +1896,16 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
}
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c Thu Feb 13 00:20:53 2014
-+++ libmagic/funcs.c Wed Mar 19 13:28:34 2014
++++ libmagic/funcs.c Sat Aug 30 10:39:10 2014
+@@ -27,7 +27,7 @@
+ #include "file.h"
+
+ #ifndef lint
+-FILE_RCSID("@(#)$File: funcs.c,v 1.67 2014/02/12 23:20:53 christos Exp $")
++FILE_RCSID("@(#)$File: funcs.c,v 1.68 2014/02/18 11:09:31 kim Exp $")
+ #endif /* lint */
+
+ #include "magic.h"
@@ -41,79 +41,79 @@
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
@@ -1865,7 +1956,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
- file_error(ms, errno, "vasprintf failed");
- return -1;
-}
-+extern public void convert_libmagic_pattern(zval *pattern, int options);
++extern public void convert_libmagic_pattern(zval *pattern, char *val, int len, int options);
protected int
file_printf(struct magic_set *ms, const char *fmt, ...)
@@ -1947,7 +2038,26 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
{
int m = 0, rv = 0, looks_text = 0;
int mime = ms->flags & MAGIC_MIME;
-@@ -203,10 +202,10 @@
+@@ -174,8 +173,7 @@
+ const char *code_mime = "binary";
+ const char *type = "application/octet-stream";
+ const char *def = "data";
+-
+-
++ const char *ftype = NULL;
+
+ if (nb == 0) {
+ def = "empty";
+@@ -188,7 +186,7 @@
+
+ if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) {
+ looks_text = file_encoding(ms, ubuf, nb, &u8buf, &ulen,
+- &code, &code_mime, &type);
++ &code, &code_mime, &ftype);
+ }
+
+ #ifdef __EMX__
+@@ -203,10 +201,10 @@
}
}
#endif
@@ -1961,7 +2071,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
if ((ms->flags & MAGIC_DEBUG) != 0)
(void)fprintf(stderr, "zmagic %d\n", m);
goto done_encoding;
-@@ -221,12 +220,17 @@
+@@ -221,12 +219,17 @@
}
/* Check if we have a CDF file */
@@ -1984,7 +2094,16 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
/* try soft magic tests */
if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0)
-@@ -300,7 +304,6 @@
+@@ -268,7 +271,7 @@
+ if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) {
+ if (looks_text == 0)
+ if ((m = file_ascmagic_with_encoding( ms, ubuf,
+- nb, u8buf, ulen, code, type, looks_text))
++ nb, u8buf, ulen, code, ftype, looks_text))
+ != 0) {
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ (void)fprintf(stderr,
+@@ -300,7 +303,6 @@
return m;
}
@@ -1992,7 +2111,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
protected int
file_reset(struct magic_set *ms)
-@@ -310,11 +313,11 @@
+@@ -310,11 +312,11 @@
return -1;
}
if (ms->o.buf) {
@@ -2006,7 +2125,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
ms->o.pbuf = NULL;
}
ms->event_flags &= ~EVENT_HAD_ERR;
-@@ -333,7 +336,7 @@
+@@ -333,7 +335,7 @@
protected const char *
file_getbuffer(struct magic_set *ms)
{
@@ -2015,7 +2134,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
size_t psize, len;
if (ms->event_flags & EVENT_HAD_ERR)
-@@ -348,15 +351,13 @@
+@@ -348,15 +350,13 @@
/* * 4 is for octal representation, + 1 is for NUL */
len = strlen(ms->o.buf);
if (len > (SIZE_MAX - 1) / 4) {
@@ -2032,7 +2151,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
#if defined(HAVE_WCHAR_H) && defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH)
{
-@@ -416,8 +417,8 @@
+@@ -416,8 +416,8 @@
if (level >= ms->c.len) {
len = (ms->c.len += 20) * sizeof(*ms->c.li);
ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
@@ -2043,7 +2162,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
if (ms->c.li == NULL) {
file_oomem(ms, len);
return -1;
-@@ -437,32 +438,50 @@
+@@ -437,32 +437,42 @@
return ms->o.buf == NULL ? 0 : strlen(ms->o.buf);
}
@@ -2052,12 +2171,12 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
{
- regex_t rx;
- int rc, rv = -1;
-+ zval *patt;
++ zval patt;
+ int opts = 0;
+ pcre_cache_entry *pce;
-+ char *res;
-+ zval *repl;
-+ int res_len, rep_cnt = 0;
++ zend_string *res;
++ zval repl;
++ int rep_cnt = 0;
+ TSRMLS_FETCH();
(void)setlocale(LC_CTYPE, "C");
@@ -2079,36 +2198,28 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
- regfree(&rx);
- rv = nm;
+
-+ MAKE_STD_ZVAL(patt);
-+ ZVAL_STRINGL(patt, pat, strlen(pat), 0);
+ opts |= PCRE_MULTILINE;
-+ convert_libmagic_pattern(patt, opts);
-+ if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(patt), Z_STRLEN_P(patt) TSRMLS_CC)) == NULL) {
-+ zval_dtor(patt);
-+ FREE_ZVAL(patt);
++ convert_libmagic_pattern(&patt, pat, strlen(pat), opts);
++ if ((pce = pcre_get_compiled_regex_cache(Z_STR(patt) TSRMLS_CC)) == NULL) {
++ zval_ptr_dtor(&patt);
+ rep_cnt = -1;
+ goto out;
}
++ zval_ptr_dtor(&patt);
+
-+ MAKE_STD_ZVAL(repl);
-+ ZVAL_STRINGL(repl, rep, strlen(rep), 0);
-+
-+ res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), repl,
-+ 0, &res_len, -1, &rep_cnt TSRMLS_CC);
-+
-+ FREE_ZVAL(repl);
-+ zval_dtor(patt);
-+ FREE_ZVAL(patt);
++ ZVAL_STRING(&repl, rep);
++ res = php_pcre_replace_impl(pce, ms->o.buf, strlen(ms->o.buf), &repl, 0, -1, &rep_cnt TSRMLS_CC);
+
++ zval_ptr_dtor(&repl);
+ if (NULL == res) {
+ rep_cnt = -1;
+ goto out;
+ }
+
-+ strncpy(ms->o.buf, res, res_len);
-+ ms->o.buf[res_len] = '\0';
++ strncpy(ms->o.buf, res->val, res->len);
++ ms->o.buf[res->len] = '\0';
+
-+ efree(res);
++ zend_string_release(res);
+
out:
(void)setlocale(LC_CTYPE, "");
@@ -2117,7 +2228,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
}
diff -u libmagic.orig/magic.c libmagic/magic.c
--- libmagic.orig/magic.c Sun Dec 1 20:22:13 2013
-+++ libmagic/magic.c Fri Feb 21 00:21:27 2014
++++ libmagic/magic.c Wed Aug 27 20:49:37 2014
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2169,7 +2280,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
+#endif
+
private void close_and_restore(const struct magic_set *, const char *, int,
- const struct stat *);
+- const struct stat *);
++ const zend_stat_t *);
private int unreadable_info(struct magic_set *, mode_t, const char *);
+#if 0
private const char* get_default_magic(void);
@@ -2262,9 +2374,12 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
public int
magic_list(struct magic_set *ms, const char *magicfile)
-@@ -282,9 +288,6 @@
+@@ -280,11 +286,8 @@
+
+ private void
close_and_restore(const struct magic_set *ms, const char *name, int fd,
- const struct stat *sb)
+- const struct stat *sb)
++ const zend_stat_t *sb)
{
- if (fd == STDIN_FILENO || name == NULL)
- return;
@@ -2311,7 +2426,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
{
int rv = -1;
unsigned char *buf;
- struct stat sb;
+- struct stat sb;
++ zend_stat_t sb;
ssize_t nbytes = 0; /* number of bytes read from a datafile */
- int ispipe = 0;
- off_t pos = (off_t)-1;
@@ -2456,7 +2572,7 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
magic_error(struct magic_set *ms)
diff -u libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h Wed Feb 19 10:53:11 2014
-+++ libmagic/magic.h Fri Feb 21 00:21:27 2014
++++ libmagic/magic.h Wed Aug 27 12:35:45 2014
@@ -88,6 +88,7 @@
const char *magic_getpath(const char *, int);
@@ -2475,7 +2591,7 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
diff -u libmagic.orig/print.c libmagic/print.c
--- libmagic.orig/print.c Tue Feb 26 19:25:00 2013
-+++ libmagic/print.c Fri Feb 21 00:21:27 2014
++++ libmagic/print.c Wed Aug 27 12:35:45 2014
@@ -28,13 +28,17 @@
/*
* print.c - debugging printout routines
@@ -2706,7 +2822,7 @@ diff -u libmagic.orig/print.c libmagic/print.c
}
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c Tue Jan 7 04:13:42 2014
-+++ libmagic/readcdf.c Thu Jun 5 18:05:33 2014
++++ libmagic/readcdf.c Wed Oct 22 17:56:13 2014
@@ -26,11 +26,15 @@
#include "file.h"
@@ -2724,7 +2840,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
#include <string.h>
#include <time.h>
#include <ctype.h>
-@@ -69,6 +73,44 @@
+@@ -69,6 +73,50 @@
{ NULL, NULL, },
};
@@ -2743,6 +2859,9 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
+ { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
+#endif
+ "x-msi",
++ },
++ { { 0, 0 },
++ NULL,
+ }
+}, clsid2desc[] = {
+ {
@@ -2753,6 +2872,9 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
+#endif
+ "MSI Installer",
+ },
++ { { 0, 0 },
++ NULL,
++ }
+};
+
+private const char *
@@ -2769,7 +2891,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
private const char *
cdf_app_to_mime(const char *vbuf, const struct nv *nv)
{
-@@ -87,16 +129,21 @@
+@@ -87,16 +135,21 @@
private int
cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
@@ -2793,7 +2915,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
for (i = 0; i < count; i++) {
cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
switch (info[i].pi_type) {
-@@ -153,7 +200,7 @@
+@@ -153,7 +206,7 @@
buf, vbuf) == -1)
return -1;
}
@@ -2802,7 +2924,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
CDF_PROPERTY_NAME_OF_APPLICATION) {
str = cdf_app_to_mime(vbuf, app2mime);
}
-@@ -162,8 +209,12 @@
+@@ -162,8 +215,12 @@
case CDF_FILETIME:
tp = info[i].pi_tp;
if (tp != 0) {
@@ -2817,7 +2939,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
cdf_print_elapsed_time(tbuf,
sizeof(tbuf), tp);
if (NOTMIME(ms) && file_printf(ms,
-@@ -171,8 +222,11 @@
+@@ -171,8 +228,11 @@
return -1;
} else {
char *c, *ec;
@@ -2831,7 +2953,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
if (c != NULL &&
(ec = strchr(c, '\n')) != NULL)
*ec = '\0';
-@@ -200,7 +254,7 @@
+@@ -200,7 +260,7 @@
private int
cdf_file_summary_info(struct magic_set *ms, const cdf_header_t *h,
@@ -2840,7 +2962,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
{
cdf_summary_info_header_t si;
cdf_property_info_t *info;
-@@ -211,6 +265,8 @@
+@@ -211,6 +271,8 @@
return -1;
if (NOTMIME(ms)) {
@@ -2849,7 +2971,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
if (file_printf(ms, "Composite Document File V2 Document")
== -1)
return -1;
-@@ -238,9 +294,15 @@
+@@ -238,9 +300,15 @@
return -2;
break;
}
@@ -2867,7 +2989,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
free(info);
return m == -1 ? -2 : m;
-@@ -258,6 +320,7 @@
+@@ -258,6 +326,7 @@
int i;
const char *expn = "";
const char *corrupt = "corrupt: ";
@@ -2875,7 +2997,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
info.i_fd = fd;
info.i_buf = buf;
-@@ -291,7 +354,8 @@
+@@ -291,7 +360,8 @@
goto out2;
}
@@ -2885,7 +3007,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
expn = "Cannot read short stream";
goto out3;
}
-@@ -312,23 +376,21 @@
+@@ -312,23 +382,21 @@
#ifdef CDF_DEBUG
cdf_dump_summary_info(&h, &scn);
#endif
@@ -2918,14 +3040,23 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
if (str != NULL) {
diff -u libmagic.orig/readelf.c libmagic/readelf.c
--- libmagic.orig/readelf.c Tue Nov 5 16:44:01 2013
-+++ libmagic/readelf.c Fri Feb 21 00:21:27 2014
-@@ -48,8 +48,8 @@
++++ libmagic/readelf.c Sat Oct 25 11:42:59 2014
+@@ -42,14 +42,14 @@
+ #include "magic.h"
+
+ #ifdef ELFCORE
+-private int dophn_core(struct magic_set *, int, int, int, off_t, int, size_t,
+- off_t, int *);
++private int dophn_core(struct magic_set *, int, int, int, zend_off_t, int, size_t,
++ zend_off_t, int *);
+ #endif
private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t,
- off_t, int *, int);
+- off_t, int *, int);
++ zend_off_t, int *, int);
private int doshn(struct magic_set *, int, int, int, off_t, int, size_t,
- off_t, int *, int, int);
-private size_t donote(struct magic_set *, void *, size_t, size_t, int,
-+ off_t, int *, int);
++ zend_off_t, int *, int);
+private size_t donote(struct magic_set *, unsigned char *, size_t, size_t, int,
int, size_t, int *);
@@ -2945,7 +3076,40 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
#define xsh_addr (clazz == ELFCLASS32 \
? (void *)&sh32 \
-@@ -292,7 +298,7 @@
+@@ -138,7 +144,7 @@
+ #define xsh_size (size_t)(clazz == ELFCLASS32 \
+ ? elf_getu32(swap, sh32.sh_size) \
+ : elf_getu64(swap, sh64.sh_size))
+-#define xsh_offset (off_t)(clazz == ELFCLASS32 \
++#define xsh_offset (zend_off_t)(clazz == ELFCLASS32 \
+ ? elf_getu32(swap, sh32.sh_offset) \
+ : elf_getu64(swap, sh64.sh_offset))
+ #define xsh_type (clazz == ELFCLASS32 \
+@@ -156,13 +162,13 @@
+ #define xph_type (clazz == ELFCLASS32 \
+ ? elf_getu32(swap, ph32.p_type) \
+ : elf_getu32(swap, ph64.p_type))
+-#define xph_offset (off_t)(clazz == ELFCLASS32 \
++#define xph_offset (zend_off_t)(clazz == ELFCLASS32 \
+ ? elf_getu32(swap, ph32.p_offset) \
+ : elf_getu64(swap, ph64.p_offset))
+ #define xph_align (size_t)((clazz == ELFCLASS32 \
+- ? (off_t) (ph32.p_align ? \
++ ? (zend_off_t) (ph32.p_align ? \
+ elf_getu32(swap, ph32.p_align) : 4) \
+- : (off_t) (ph64.p_align ? \
++ : (zend_off_t) (ph64.p_align ? \
+ elf_getu64(swap, ph64.p_align) : 4)))
+ #define xph_filesz (size_t)((clazz == ELFCLASS32 \
+ ? elf_getu32(swap, ph32.p_filesz) \
+@@ -287,12 +293,12 @@
+ #define FLAGS_IS_CORE 0x10
+
+ private int
+-dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
+- int num, size_t size, off_t fsize, int *flags)
++dophn_core(struct magic_set *ms, int clazz, int swap, int fd, zend_off_t off,
++ int num, size_t size, zend_off_t fsize, int *flags)
{
Elf32_Phdr ph32;
Elf64_Phdr ph64;
@@ -2959,7 +3123,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
*/
for ( ; num; num--) {
- if (pread(fd, xph_addr, xph_sizeof, off) == -1) {
-+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (off_t)-1) {
++ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) {
+ file_badseek(ms);
+ return -1;
+ }
@@ -2973,7 +3137,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
*/
- len = xph_filesz < sizeof(nbuf) ? xph_filesz : sizeof(nbuf);
- if ((bufsize = pread(fd, nbuf, len, xph_offset)) == -1) {
-+ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (off_t)-1) {
++ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (zend_off_t)-1) {
+ file_badseek(ms);
+ return -1;
+ }
@@ -2983,7 +3147,30 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
file_badread(ms);
return -1;
}
-@@ -913,24 +928,12 @@
+@@ -477,6 +492,13 @@
+ uint32_t namesz, descsz;
+ unsigned char *nbuf = CAST(unsigned char *, vbuf);
+
++ if (xnh_sizeof + offset > size) {
++ /*
++ * We're out of note headers.
++ */
++ return xnh_sizeof + offset;
++ }
++
+ (void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
+ offset += xnh_sizeof;
+
+@@ -902,7 +924,7 @@
+ Elf64_Shdr sh64;
+ int stripped = 1;
+ void *nbuf;
+- off_t noff, coff, name_off;
++ zend_off_t noff, coff, name_off;
+ uint64_t cap_hw1 = 0; /* SunOS 5.x hardware capabilites */
+ uint64_t cap_sf1 = 0; /* SunOS 5.x software capabilites */
+ char name[50];
+@@ -913,24 +935,12 @@
return 0;
}
@@ -2998,7 +3185,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
- /* Read the name of this section. */
- if (pread(fd, name, sizeof(name), name_off + xsh_name) == -1) {
- file_badread(ms);
-+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (off_t)-1) {
++ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) {
+ file_badseek(ms);
return -1;
}
@@ -3011,7 +3198,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
file_badread(ms);
return -1;
}
-@@ -955,14 +958,17 @@
+@@ -955,41 +965,35 @@
/* Things we can determine when we seek */
switch (xsh_type) {
case SHT_NOTE:
@@ -3019,8 +3206,8 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
- file_error(ms, errno, "Cannot allocate memory"
- " for note");
+ nbuf = emalloc((size_t)xsh_size);
-+ if ((noff = FINFO_LSEEK_FUNC(fd, (off_t)xsh_offset, SEEK_SET)) ==
-+ (off_t)-1) {
++ if ((noff = FINFO_LSEEK_FUNC(fd, (zend_off_t)xsh_offset, SEEK_SET)) ==
++ (zend_off_t)-1) {
+ file_badread(ms);
+ efree(nbuf);
return -1;
@@ -3034,8 +3221,10 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
return -1;
}
-@@ -971,25 +977,16 @@
- if (noff >= (off_t)xsh_size)
+ noff = 0;
+ for (;;) {
+- if (noff >= (off_t)xsh_size)
++ if (noff >= (zend_off_t)xsh_size)
break;
noff = donote(ms, nbuf, (size_t)noff,
- xsh_size, clazz, swap, 4, flags);
@@ -3060,21 +3249,24 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
- }
-
- if (lseek(fd, xsh_offset, SEEK_SET) == (off_t)-1) {
-+ if (FINFO_LSEEK_FUNC(fd, (off_t)xsh_offset, SEEK_SET) ==
-+ (off_t)-1) {
++ if (FINFO_LSEEK_FUNC(fd, (zend_off_t)xsh_offset, SEEK_SET) ==
++ (zend_off_t)-1) {
file_badseek(ms);
return -1;
}
-@@ -1001,7 +998,7 @@
+@@ -999,9 +1003,9 @@
+ Elf64_Cap cap64;
+ char cbuf[/*CONSTCOND*/
MAX(sizeof cap32, sizeof cap64)];
- if ((coff += xcap_sizeof) > (off_t)xsh_size)
+- if ((coff += xcap_sizeof) > (off_t)xsh_size)
++ if ((coff += xcap_sizeof) > (zend_off_t)xsh_size)
break;
- if (read(fd, cbuf, (size_t)xcap_sizeof) !=
+ if (FINFO_READ_FUNC(fd, cbuf, (size_t)xcap_sizeof) !=
(ssize_t)xcap_sizeof) {
file_badread(ms);
return -1;
-@@ -1027,13 +1024,12 @@
+@@ -1027,13 +1031,12 @@
break;
}
}
@@ -3090,7 +3282,18 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
if (file_printf(ms, ", %sstripped", stripped ? "" : "not ") == -1)
return -1;
if (cap_hw1) {
-@@ -1112,7 +1108,7 @@
+@@ -1103,8 +1106,8 @@
+ * otherwise it's statically linked.
+ */
+ private int
+-dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
+- int num, size_t size, off_t fsize, int *flags, int sh_num)
++dophn_exec(struct magic_set *ms, int clazz, int swap, int fd, zend_off_t off,
++ int num, size_t size, zend_off_t fsize, int *flags, int sh_num)
+ {
+ Elf32_Phdr ph32;
+ Elf64_Phdr ph64;
+@@ -1112,7 +1115,7 @@
const char *shared_libraries = "";
unsigned char nbuf[BUFSIZ];
ssize_t bufsize;
@@ -3099,13 +3302,13 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
if (size != xph_sizeof) {
if (file_printf(ms, ", corrupted program header size") == -1)
-@@ -1121,8 +1117,13 @@
+@@ -1121,8 +1124,13 @@
}
for ( ; num; num--) {
- if (pread(fd, xph_addr, xph_sizeof, off) == -1) {
- file_badread(ms);
-+ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (off_t)-1) {
++ if (FINFO_LSEEK_FUNC(fd, off, SEEK_SET) == (zend_off_t)-1) {
+ file_badseek(ms);
+ return -1;
+ }
@@ -3115,14 +3318,14 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
return -1;
}
-@@ -1160,9 +1161,12 @@
+@@ -1160,9 +1168,12 @@
* This is a PT_NOTE section; loop through all the notes
* in the section.
*/
- len = xph_filesz < sizeof(nbuf) ? xph_filesz
- : sizeof(nbuf);
- bufsize = pread(fd, nbuf, len, xph_offset);
-+ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (off_t)-1) {
++ if (FINFO_LSEEK_FUNC(fd, xph_offset, SEEK_SET) == (zend_off_t)-1) {
+ file_badseek(ms);
+ return -1;
+ }
@@ -3131,18 +3334,27 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c
if (bufsize == -1) {
file_badread(ms);
return -1;
-@@ -1223,7 +1227,7 @@
+@@ -1200,7 +1211,7 @@
+ int clazz;
+ int swap;
+ struct stat st;
+- off_t fsize;
++ zend_off_t fsize;
+ int flags = 0;
+ Elf32_Ehdr elf32hdr;
+ Elf64_Ehdr elf64hdr;
+@@ -1223,7 +1234,7 @@
/*
* If we cannot seek, it must be a pipe, socket or fifo.
*/
- if((lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE))
-+ if((FINFO_LSEEK_FUNC(fd, (off_t)0, SEEK_SET) == (off_t)-1) && (errno == ESPIPE))
++ if((FINFO_LSEEK_FUNC(fd, (zend_off_t)0, SEEK_SET) == (zend_off_t)-1) && (errno == ESPIPE))
fd = file_pipe2file(ms, fd, buf, nbytes);
if (fstat(fd, &st) == -1) {
diff -u libmagic.orig/readelf.h libmagic/readelf.h
--- libmagic.orig/readelf.h Tue Nov 5 16:41:56 2013
-+++ libmagic/readelf.h Fri Feb 21 00:21:27 2014
++++ libmagic/readelf.h Wed Aug 27 12:35:45 2014
@@ -44,9 +44,17 @@
typedef uint32_t Elf32_Word;
typedef uint8_t Elf32_Char;
@@ -3163,7 +3375,7 @@ diff -u libmagic.orig/readelf.h libmagic/readelf.h
typedef uint8_t Elf64_Char;
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c Thu Feb 13 00:20:53 2014
-+++ libmagic/softmagic.c Tue Jul 1 08:57:25 2014
++++ libmagic/softmagic.c Fri Sep 19 16:29:55 2014
@@ -50,6 +50,11 @@
#include <locale.h>
#endif
@@ -3176,6 +3388,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
private int match(struct magic_set *, struct magic *, uint32_t,
const unsigned char *, size_t, size_t, int, int, int, int, int *, int *,
+@@ -62,7 +67,7 @@
+ private int32_t moffset(struct magic_set *, struct magic *);
+ private void mdebug(uint32_t, const char *, size_t);
+ private int mcopy(struct magic_set *, union VALUETYPE *, int, int,
+- const unsigned char *, uint32_t, size_t, size_t);
++ const unsigned char *, uint32_t, size_t, struct magic *);
+ private int mconvert(struct magic_set *, struct magic *, int);
+ private int print_sep(struct magic_set *, int);
+ private int handle_annotation(struct magic_set *, struct magic *);
@@ -71,7 +76,8 @@
private void cvt_32(union VALUETYPE *, const struct magic *);
private void cvt_64(union VALUETYPE *, const struct magic *);
@@ -3206,7 +3427,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
m = &magic[magindex];
ms->line = m->lineno; /* for messages */
-@@ -350,46 +356,24 @@
+@@ -350,46 +356,27 @@
private int
check_fmt(struct magic_set *ms, struct magic *m)
{
@@ -3216,6 +3437,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
+ pcre *pce;
+ int re_options, rv = -1;
+ pcre_extra *re_extra;
++ zend_string *pattern;
+ TSRMLS_FETCH();
+
if (strchr(m->desc, '%') == NULL)
@@ -3227,7 +3449,8 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
- char errmsg[512];
- (void)regerror(rc, &rx, errmsg, sizeof(errmsg));
- file_magerror(ms, "regex error %d, (%s)", rc, errmsg);
-+ if ((pce = pcre_get_compiled_regex("~%[-0-9.]*s~", &re_extra, &re_options TSRMLS_CC)) == NULL) {
++ pattern = zend_string_init("~%[-0-9.]*s~", sizeof("~%[-0-9.]*s~") - 1, 0);
++ if ((pce = pcre_get_compiled_regex(pattern, &re_extra, &re_options TSRMLS_CC)) == NULL) {
+ rv = -1;
} else {
- rc = regexec(&rx, m->desc, 0, 0, 0);
@@ -3235,6 +3458,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
- rv = !rc;
+ rv = !pcre_exec(pce, re_extra, m->desc, strlen(m->desc), 0, re_options, NULL, 0);
}
++ zend_string_release(pattern);
(void)setlocale(LC_CTYPE, "");
return rv;
}
@@ -3261,7 +3485,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
private int32_t
mprint(struct magic_set *ms, struct magic *m)
{
-@@ -618,13 +602,13 @@
+@@ -618,13 +605,13 @@
char *cp;
int rval;
@@ -3277,7 +3501,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
if (rval == -1)
return -1;
-@@ -870,16 +854,16 @@
+@@ -870,16 +857,16 @@
if (m->num_mask) \
switch (m->mask_op & FILE_OPS_MASK) { \
case FILE_OPADD: \
@@ -3298,7 +3522,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
break; \
} \
-@@ -931,10 +915,18 @@
+@@ -931,10 +918,18 @@
return 1;
}
case FILE_PSTRING: {
@@ -3320,9 +3544,72 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
while (len--)
*ptr1++ = *ptr2++;
*ptr1 = '\0';
-@@ -1178,9 +1170,6 @@
- "nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o,
- nbytes, count);
+@@ -1046,7 +1041,7 @@
+
+ private int
+ mcopy(struct magic_set *ms, union VALUETYPE *p, int type, int indir,
+- const unsigned char *s, uint32_t offset, size_t nbytes, size_t linecnt)
++ const unsigned char *s, uint32_t offset, size_t nbytes, struct magic *m)
+ {
+ /*
+ * Note: FILE_SEARCH and FILE_REGEX do not actually copy
+@@ -1066,15 +1061,24 @@
+ const char *last; /* end of search region */
+ const char *buf; /* start of search region */
+ const char *end;
+- size_t lines;
++ size_t lines, linecnt, bytecnt;
++
++ linecnt = m->str_range;
++ bytecnt = linecnt * 80;
+
++ if (bytecnt == 0) {
++ bytecnt = 8192;
++ }
++ if (bytecnt > nbytes) {
++ bytecnt = nbytes;
++ }
+ if (s == NULL) {
+ ms->search.s_len = 0;
+ ms->search.s = NULL;
+ return 0;
+ }
+ buf = RCAST(const char *, s) + offset;
+- end = last = RCAST(const char *, s) + nbytes;
++ end = last = RCAST(const char *, s) + bytecnt;
+ /* mget() guarantees buf <= last */
+ for (lines = linecnt, b = buf; lines && b < end &&
+ ((b = CAST(const char *,
+@@ -1087,7 +1091,7 @@
+ b++;
+ }
+ if (lines)
+- last = RCAST(const char *, s) + nbytes;
++ last = RCAST(const char *, s) + bytecnt;
+
+ ms->search.s = buf;
+ ms->search.s_len = last - buf;
+@@ -1158,7 +1162,6 @@
+ int *need_separator, int *returnval)
+ {
+ uint32_t soffset, offset = ms->offset;
+- uint32_t count = m->str_range;
+ int rv, oneed_separator, in_type;
+ char *sbuf, *rbuf;
+ union VALUETYPE *p = &ms->ms_value;
+@@ -1170,17 +1173,13 @@
+ }
+
+ if (mcopy(ms, p, m->type, m->flag & INDIR, s, (uint32_t)(offset + o),
+- (uint32_t)nbytes, count) == -1)
++ (uint32_t)nbytes, m) == -1)
+ return -1;
+
+ if ((ms->flags & MAGIC_DEBUG) != 0) {
+ fprintf(stderr, "mget(type=%d, flag=%x, offset=%u, o=%zu, "
+- "nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o,
+- nbytes, count);
++ "nbytes=%zu)\n", m->type, m->flag, offset, o, nbytes);
mdebug(offset, (char *)(void *)p, sizeof(union VALUETYPE));
-#ifndef COMPILE_ONLY
- file_mdump(m);
@@ -3330,7 +3617,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
if (m->flag & INDIR) {
-@@ -1679,9 +1668,6 @@
+@@ -1672,16 +1671,13 @@
+ if ((ms->flags & MAGIC_DEBUG) != 0)
+ fprintf(stderr, "indirect +offs=%u\n", offset);
+ }
+- if (mcopy(ms, p, m->type, 0, s, offset, nbytes, count) == -1)
++ if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1)
+ return -1;
+ ms->offset = offset;
+
if ((ms->flags & MAGIC_DEBUG) != 0) {
mdebug(offset, (char *)(void *)p,
sizeof(union VALUETYPE));
@@ -3340,7 +3635,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
}
-@@ -1755,11 +1741,21 @@
+@@ -1755,11 +1751,21 @@
ms->offset = soffset;
if (rv == 1) {
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
@@ -3365,50 +3660,49 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
return rv;
-@@ -1875,6 +1871,42 @@
+@@ -1875,6 +1881,41 @@
return file_strncmp(a, b, len, flags);
}
+public void
-+convert_libmagic_pattern(zval *pattern, int options)
++convert_libmagic_pattern(zval *pattern, char *val, int len, int options)
+{
-+ int i, j=0;
-+ char *t;
++ int i, j=0;
++ zend_string *t;
+
-+ t = (char *) safe_emalloc(Z_STRLEN_P(pattern), 2, 5);
-+
-+ t[j++] = '~';
-+
-+ for (i=0; i<Z_STRLEN_P(pattern); i++, j++) {
-+ switch (Z_STRVAL_P(pattern)[i]) {
-+ case '~':
-+ t[j++] = '\\';
-+ t[j] = '~';
-+ break;
-+ default:
-+ t[j] = Z_STRVAL_P(pattern)[i];
-+ break;
-+ }
++ t = zend_string_alloc(len * 2 + 4, 0);
++
++ t->val[j++] = '~';
++
++ for (i = 0; i < len; i++, j++) {
++ switch (val[i]) {
++ case '~':
++ t->val[j++] = '\\';
++ t->val[j] = '~';
++ break;
++ default:
++ t->val[j] = val[i];
++ break;
+ }
-+ t[j++] = '~';
-+
-+ if (options & PCRE_CASELESS)
-+ t[j++] = 'i';
-+
-+ if (options & PCRE_MULTILINE)
-+ t[j++] = 'm';
++ }
++ t->val[j++] = '~';
+
-+ t[j]='\0';
-+
-+ Z_STRVAL_P(pattern) = t;
-+ Z_STRLEN_P(pattern) = j;
++ if (options & PCRE_CASELESS)
++ t->val[j++] = 'i';
++
++ if (options & PCRE_MULTILINE)
++ t->val[j++] = 'm';
+
++ t->val[j]='\0';
++ t->len = j;
++
++ ZVAL_NEW_STR(pattern, t);
+}
+
private int
magiccheck(struct magic_set *ms, struct magic *m)
{
-@@ -2035,63 +2067,151 @@
+@@ -2035,63 +2076,112 @@
break;
}
case FILE_REGEX: {
@@ -3418,141 +3712,61 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
-
- if (ms->search.s == NULL)
- return 0;
-+ zval *pattern;
++ zval pattern;
+ int options = 0;
+ pcre_cache_entry *pce;
+ TSRMLS_FETCH();
+
-+ MAKE_STD_ZVAL(pattern);
-+ ZVAL_STRINGL(pattern, (char *)m->value.s, m->vallen, 0);
-+
+ options |= PCRE_MULTILINE;
+
+ if (m->str_flags & STRING_IGNORE_CASE) {
+ options |= PCRE_CASELESS;
+ }
+
-+ convert_libmagic_pattern(pattern, options);
++ convert_libmagic_pattern(&pattern, (char *)m->value.s, m->vallen, options);
+
+ l = v = 0;
-+ if ((pce = pcre_get_compiled_regex_cache(Z_STRVAL_P(pattern), Z_STRLEN_P(pattern) TSRMLS_CC)) == NULL) {
-+ zval_dtor(pattern);
-+ FREE_ZVAL(pattern);
++ if ((pce = pcre_get_compiled_regex_cache(Z_STR(pattern) TSRMLS_CC)) == NULL) {
++ zval_ptr_dtor(&pattern);
+ return -1;
+ } else {
+ /* pce now contains the compiled regex */
-+ zval *retval;
-+ zval *subpats;
++ zval retval;
++ zval subpats;
+ char *haystack;
+
-+ MAKE_STD_ZVAL(retval);
-+ ALLOC_INIT_ZVAL(subpats);
-+
++ ZVAL_NULL(&retval);
++ ZVAL_NULL(&subpats);
++
+ /* Cut the search len from haystack, equals to REG_STARTEND */
+ haystack = estrndup(ms->search.s, ms->search.s_len);
+
+ /* match v = 0, no match v = 1 */
-+ php_pcre_match_impl(pce, haystack, ms->search.s_len, retval, subpats, 1, 1, PREG_OFFSET_CAPTURE, 0 TSRMLS_CC);
++ php_pcre_match_impl(pce, haystack, ms->search.s_len, &retval, &subpats, 1, 1, PREG_OFFSET_CAPTURE, 0 TSRMLS_CC);
+ /* Free haystack */
+ efree(haystack);
+
-+ if (Z_LVAL_P(retval) < 0) {
++ if (Z_LVAL(retval) < 0) {
+ zval_ptr_dtor(&subpats);
-+ FREE_ZVAL(retval);
-+ zval_dtor(pattern);
-+ FREE_ZVAL(pattern);
++ zval_ptr_dtor(&pattern);
+ return -1;
-+ } else if ((Z_LVAL_P(retval) > 0) && (Z_TYPE_P(subpats) == IS_ARRAY)) {
-+
++ } else if ((Z_LVAL(retval) > 0) && (Z_TYPE(subpats) == IS_ARRAY)) {
+ /* Need to fetch global match which equals pmatch[0] */
-+ HashTable *ht = Z_ARRVAL_P(subpats);
-+ HashPosition outer_pos;
++ zval *pzval;
++ HashTable *ht = Z_ARRVAL(subpats);
+ zval *pattern_match = NULL, *pattern_offset = NULL;
-+
-+ zend_hash_internal_pointer_reset_ex(ht, &outer_pos);
-+
-+ if (zend_hash_has_more_elements_ex(ht, &outer_pos) == SUCCESS &&
-+ zend_hash_move_forward_ex(ht, &outer_pos)) {
-+
-+ zval **ppzval;
-+
-+ /* The first element (should be) is the global match
-+ Need to move to the inner array to get the global match */
-+
-+ if (zend_hash_get_current_data_ex(ht, (void**)&ppzval, &outer_pos) != FAILURE) {
-+
-+ HashTable *inner_ht;
-+ HashPosition inner_pos;
-+ zval **match, **offset;
-+ zval tmpcopy = **ppzval, matchcopy, offsetcopy;
-+
-+ zval_copy_ctor(&tmpcopy);
-+ INIT_PZVAL(&tmpcopy);
-+
-+ inner_ht = Z_ARRVAL(tmpcopy);
-+
-+ /* If everything goes according to the master plan
-+ tmpcopy now contains two elements:
-+ 0 = the match
-+ 1 = starting position of the match */
-+ zend_hash_internal_pointer_reset_ex(inner_ht, &inner_pos);
-+
-+ if (zend_hash_has_more_elements_ex(inner_ht, &inner_pos) == SUCCESS &&
-+ zend_hash_move_forward_ex(inner_ht, &inner_pos)) {
-+
-+ if (zend_hash_get_current_data_ex(inner_ht, (void**)&match, &inner_pos) != FAILURE) {
-+
-+ matchcopy = **match;
-+ zval_copy_ctor(&matchcopy);
-+ INIT_PZVAL(&matchcopy);
-+ convert_to_string(&matchcopy);
-+
-+ MAKE_STD_ZVAL(pattern_match);
-+ Z_STRVAL_P(pattern_match) = (char *)Z_STRVAL(matchcopy);
-+ Z_STRLEN_P(pattern_match) = Z_STRLEN(matchcopy);
-+ Z_TYPE_P(pattern_match) = IS_STRING;
-+
-+ zval_dtor(&matchcopy);
-+ }
-+ }
-+
-+ if (zend_hash_has_more_elements_ex(inner_ht, &inner_pos) == SUCCESS &&
-+ zend_hash_move_forward_ex(inner_ht, &inner_pos)) {
-+
-+ if (zend_hash_get_current_data_ex(inner_ht, (void**)&offset, &inner_pos) != FAILURE) {
-+
-+ offsetcopy = **offset;
-+ zval_copy_ctor(&offsetcopy);
-+ INIT_PZVAL(&offsetcopy);
-+ convert_to_long(&offsetcopy);
-+
-+ MAKE_STD_ZVAL(pattern_offset);
-+ Z_LVAL_P(pattern_offset) = Z_LVAL(offsetcopy);
-+ Z_TYPE_P(pattern_offset) = IS_LONG;
-+
-+ zval_dtor(&offsetcopy);
-+ }
-+ }
-+ zval_dtor(&tmpcopy);
-+ }
-+
-+ if ((pattern_match != NULL) && (pattern_offset != NULL)) {
-+ ms->search.s += (int)Z_LVAL_P(pattern_offset); /* this is where the match starts */
-+ ms->search.offset += (size_t)Z_LVAL_P(pattern_offset); /* this is where the match starts as size_t */
-+ ms->search.rm_len = Z_STRLEN_P(pattern_match) /* This is the length of the matched pattern */;
-+ v = 0;
-+
-+ efree(pattern_match);
-+ efree(pattern_offset);
-+
-+ } else {
-+ zval_ptr_dtor(&subpats);
-+ FREE_ZVAL(retval);
-+ zval_dtor(pattern);
-+ FREE_ZVAL(pattern);
-+ return -1;
++ int first = 1, inner_first;
++
++ ZEND_HASH_FOREACH_VAL(ht, pzval) {
++ HashTable *inner_ht;
++ zval *match, *offset;
++ zval tmpcopy, matchcopy, offsetcopy;
++
++ if (first) {
++ first = 0;
++ continue;
+ }
-+ }
++ ZVAL_DUP(&tmpcopy, pzval);
- l = 0;
- rc = regcomp(&rx, m->value.s,
@@ -3588,8 +3802,51 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
- (size_t)(pmatch[0].rm_eo - pmatch[0].rm_so);
- v = 0;
- break;
++ inner_ht = Z_ARRVAL(tmpcopy);
- case REG_NOMATCH:
++ /* If everything goes according to the master plan
++ tmpcopy now contains two elements:
++ 0 = the match
++ 1 = starting position of the match */
++ inner_first = 1;
++ ZEND_HASH_FOREACH_VAL(inner_ht, match) {
++ if (inner_first) {
++ inner_first = 0;
++ continue;
++ }
++ ZVAL_DUP(&matchcopy, match);
++ convert_to_string(&matchcopy);
++ pattern_match = &matchcopy;
++ } ZEND_HASH_FOREACH_END();
++
++ inner_first = 1;
++ ZEND_HASH_FOREACH_VAL(inner_ht, offset) {
++ if (inner_first) {
++ inner_first = 0;
++ continue;
++ }
++ ZVAL_DUP(&offsetcopy, offset);
++ convert_to_long(&offsetcopy);
++ pattern_offset = &offsetcopy;
++ } ZEND_HASH_FOREACH_END();
++
++ zval_dtor(&tmpcopy);
++
++ if ((pattern_match != NULL) && (pattern_offset != NULL)) {
++ ms->search.s += Z_LVAL_P(pattern_offset); /* this is where the match starts */
++ ms->search.offset += Z_LVAL_P(pattern_offset); /* this is where the match starts as size_t */
++ ms->search.rm_len = Z_STRLEN_P(pattern_match) /* This is the length of the matched pattern */;
++ v = 0;
++
++ zval_ptr_dtor(pattern_match);
++ zval_ptr_dtor(pattern_offset);
++ } else {
++ zval_ptr_dtor(&subpats);
++ zval_ptr_dtor(&pattern);
++ return -1;
++ }
++ } ZEND_HASH_FOREACH_END();
+ } else {
v = 1;
- break;
@@ -3603,18 +3860,16 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
- regfree(&rx);
+ zval_ptr_dtor(&subpats);
-+ FREE_ZVAL(retval);
++ zval_ptr_dtor(&pattern);
}
- if (v == (uint64_t)-1)
- return -1;
-+ zval_dtor(pattern);
-+ FREE_ZVAL(pattern);
break;
}
case FILE_INDIRECT:
diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
--- libmagic.orig/strcasestr.c Thu Dec 5 17:57:50 2013
-+++ libmagic/strcasestr.c Sun May 4 21:29:20 2014
++++ libmagic/strcasestr.c Wed Aug 27 12:35:45 2014
@@ -37,6 +37,8 @@
__RCSID("$NetBSD: strncasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif /* LIBC_SCCS and not lint */
diff --git a/ext/fileinfo/libmagic/readelf.c b/ext/fileinfo/libmagic/readelf.c
index 3b0aae54c1..a849c1a098 100644
--- a/ext/fileinfo/libmagic/readelf.c
+++ b/ext/fileinfo/libmagic/readelf.c
@@ -492,6 +492,13 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
uint32_t namesz, descsz;
unsigned char *nbuf = CAST(unsigned char *, vbuf);
+ if (xnh_sizeof + offset > size) {
+ /*
+ * We're out of note headers.
+ */
+ return xnh_sizeof + offset;
+ }
+
(void)memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
offset += xnh_sizeof;
diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c
index b7c0b49a85..be1c2f0d40 100644
--- a/ext/filter/logical_filters.c
+++ b/ext/filter/logical_filters.c
@@ -80,7 +80,7 @@
#define FORMAT_IPV4 4
#define FORMAT_IPV6 6
-static int php_filter_parse_int(const char *str, unsigned int str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
+static int php_filter_parse_int(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
zend_long ctx_value;
int sign = 0, digit = 0;
const char *end = str + str_len;
@@ -132,7 +132,7 @@ static int php_filter_parse_int(const char *str, unsigned int str_len, zend_long
}
/* }}} */
-static int php_filter_parse_octal(const char *str, unsigned int str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
+static int php_filter_parse_octal(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
zend_ulong ctx_value = 0;
const char *end = str + str_len;
@@ -155,7 +155,7 @@ static int php_filter_parse_octal(const char *str, unsigned int str_len, zend_lo
}
/* }}} */
-static int php_filter_parse_hex(const char *str, unsigned int str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
+static int php_filter_parse_hex(const char *str, size_t str_len, zend_long *ret TSRMLS_DC) { /* {{{ */
zend_ulong ctx_value = 0;
const char *end = str + str_len;
zend_ulong n;
@@ -188,7 +188,8 @@ void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
zend_long min_range, max_range, option_flags;
int min_range_set, max_range_set;
int allow_octal = 0, allow_hex = 0;
- int len, error = 0;
+ size_t len;
+ int error = 0;
zend_long ctx_value;
char *p;
@@ -250,7 +251,7 @@ void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
{
char *str = Z_STRVAL_P(value);
- int len = Z_STRLEN_P(value);
+ size_t len = Z_STRLEN_P(value);
int ret;
PHP_FILTER_TRIM_DEFAULT_EX(str, len, 0);
@@ -318,12 +319,13 @@ void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
{
- int len;
+ size_t len;
char *str, *end;
char *num, *p;
zval *option_val;
char *decimal;
- int decimal_set, decimal_len;
+ int decimal_set;
+ size_t decimal_len;
char dec_sep = '.';
char tsd_sep[3] = "',.";
@@ -400,7 +402,7 @@ void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
switch (is_numeric_string(num, p - num, &lval, &dval, 0)) {
case IS_LONG:
zval_ptr_dtor(value);
- ZVAL_DOUBLE(value, lval);
+ ZVAL_DOUBLE(value, (double)lval);
break;
case IS_DOUBLE:
if ((!dval && p - num > 1 && strpbrk(num, "123456789")) || !zend_finite(dval)) {
@@ -443,7 +445,7 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
if (!re) {
RETURN_VALIDATION_FAILED
}
- matches = pcre_exec(re, NULL, Z_STRVAL_P(value), Z_STRLEN_P(value), 0, 0, ovector, 3);
+ matches = pcre_exec(re, NULL, Z_STRVAL_P(value), (int)Z_STRLEN_P(value), 0, 0, ovector, 3);
/* 0 means that the vector is too small to hold all the captured substring offsets */
if (matches < 0) {
@@ -455,7 +457,7 @@ void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
{
php_url *url;
- int old_len = Z_STRLEN_P(value);
+ int old_len = (int)Z_STRLEN_P(value);
php_filter_url(value, flags, option_array, charset TSRMLS_CC);
@@ -554,7 +556,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
RETURN_VALIDATION_FAILED
}
zend_string_release(sregexp);
- matches = pcre_exec(re, NULL, Z_STRVAL_P(value), Z_STRLEN_P(value), 0, 0, ovector, 3);
+ matches = pcre_exec(re, NULL, Z_STRVAL_P(value), (int)Z_STRLEN_P(value), 0, 0, ovector, 3);
/* 0 means that the vector is too small to hold all the captured substring offsets */
if (matches < 0) {
@@ -564,7 +566,7 @@ void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
}
/* }}} */
-static int _php_filter_validate_ipv4(char *str, int str_len, int *ip) /* {{{ */
+static int _php_filter_validate_ipv4(char *str, size_t str_len, int *ip) /* {{{ */
{
const char *end = str + str_len;
int num, m;
@@ -599,7 +601,7 @@ static int _php_filter_validate_ipv4(char *str, int str_len, int *ip) /* {{{ */
}
/* }}} */
-static int _php_filter_validate_ipv6(char *str, int str_len TSRMLS_DC) /* {{{ */
+static int _php_filter_validate_ipv6(char *str, size_t str_len TSRMLS_DC) /* {{{ */
{
int compressed = 0;
int blocks = 0;
@@ -792,8 +794,9 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
{
char *input = Z_STRVAL_P(value);
- int input_len = Z_STRLEN_P(value);
- int tokens, length, i, offset, exp_separator_set, exp_separator_len;
+ size_t input_len = Z_STRLEN_P(value);
+ int tokens, length, i, offset, exp_separator_set;
+ size_t exp_separator_len;
char separator;
char *exp_separator;
zend_long ret = 0;
diff --git a/ext/filter/sanitizing_filters.c b/ext/filter/sanitizing_filters.c
index 083b5382b6..851238fe45 100644
--- a/ext/filter/sanitizing_filters.c
+++ b/ext/filter/sanitizing_filters.c
@@ -30,7 +30,7 @@ typedef unsigned long filter_map[256];
static void php_filter_encode_html(zval *value, const unsigned char *chars)
{
smart_str str = {0};
- int len = Z_STRLEN_P(value);
+ size_t len = Z_STRLEN_P(value);
unsigned char *s = (unsigned char *)Z_STRVAL_P(value);
unsigned char *e = s + len;
@@ -147,7 +147,7 @@ static void filter_map_init(filter_map *map)
static void filter_map_update(filter_map *map, int flag, const unsigned char *allowed_list)
{
- int l, i;
+ size_t l, i;
l = strlen((const char*)allowed_list);
for (i = 0; i < l; ++i) {
diff --git a/ext/gd/config.w32 b/ext/gd/config.w32
index 2127fc5dce..da6d0d2ff5 100644
--- a/ext/gd/config.w32
+++ b/ext/gd/config.w32
@@ -83,6 +83,9 @@ if (PHP_GD != "no") {
/D USE_GD_IOCTX \
/D MSWIN32 \
");
+ if (ICC_TOOLSET) {
+ ADD_FLAG("LDFLAGS_GD", "/nodefaultlib:libcmt");
+ }
PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd" );
} else {
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index 2a77132ba3..78d471c9d6 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -362,30 +362,6 @@ static inline void gmp_zval_unary_ui_op(zval *return_value, zval *a_arg, gmp_una
#define gmp_unary_opl(op) _gmp_unary_opl(INTERNAL_FUNCTION_PARAM_PASSTHRU, op)
#define gmp_unary_ui_op(op) _gmp_unary_ui_op(INTERNAL_FUNCTION_PARAM_PASSTHRU, op)
-/* {{{ gmp_emalloc
- */
-static void *gmp_emalloc(size_t size)
-{
- return emalloc(size);
-}
-/* }}} */
-
-/* {{{ gmp_erealloc
- */
-static void *gmp_erealloc(void *ptr, size_t old_size, size_t new_size)
-{
- return erealloc(ptr, new_size);
-}
-/* }}} */
-
-/* {{{ gmp_efree
- */
-static void gmp_efree(void *ptr, size_t size)
-{
- efree(ptr);
-}
-/* }}} */
-
static void gmp_free_object_storage(zend_object *obj TSRMLS_DC) /* {{{ */
{
gmp_object *intern = GET_GMP_OBJECT_FROM_OBJ(obj);
@@ -693,8 +669,6 @@ ZEND_MINIT_FUNCTION(gmp)
REGISTER_LONG_CONSTANT("GMP_BIG_ENDIAN", GMP_BIG_ENDIAN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("GMP_NATIVE_ENDIAN", GMP_NATIVE_ENDIAN, CONST_CS | CONST_PERSISTENT);
- mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree);
-
return SUCCESS;
}
/* }}} */
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 4fb6df123e..c8dcc15e99 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -414,7 +414,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
mimetype = SG(sapi_headers).mimetype;
} else {
mimetype = SG(sapi_headers).mimetype;
- mimetype_len = s - SG(sapi_headers).mimetype;
+ mimetype_len = (int)(s - SG(sapi_headers).mimetype);
}
} else if (SG(sapi_headers).send_default_content_type) {
mimetype = SG(default_mimetype) ? SG(default_mimetype) : SAPI_DEFAULT_MIMETYPE;
@@ -429,7 +429,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
} else {
len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, get_output_encoding(TSRMLS_C));
}
- if (content_type && SUCCESS == sapi_add_header(content_type, len, 0)) {
+ if (content_type && SUCCESS == sapi_add_header(content_type, (uint)len, 0)) {
SG(sapi_headers).send_default_content_type = 0;
php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
}
@@ -2306,7 +2306,7 @@ PHP_FUNCTION(iconv_mime_decode)
RETURN_FALSE;
}
- err = _php_iconv_mime_decode(&retval, encoded_str->val, encoded_str->len, charset, NULL, mode);
+ err = _php_iconv_mime_decode(&retval, encoded_str->val, encoded_str->len, charset, NULL, (int)mode);
_php_iconv_show_error(err, charset, "???" TSRMLS_CC);
if (err == PHP_ICONV_ERR_SUCCESS) {
@@ -2359,7 +2359,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
char *p, *limit;
const char *next_pos;
- if (PHP_ICONV_ERR_SUCCESS != (err = _php_iconv_mime_decode(&decoded_header, enc_str_tmp, enc_str_len_tmp, charset, &next_pos, mode))) {
+ if (PHP_ICONV_ERR_SUCCESS != (err = _php_iconv_mime_decode(&decoded_header, enc_str_tmp, enc_str_len_tmp, charset, &next_pos, (int)mode))) {
smart_str_free(&decoded_header);
break;
}
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index 82cbe72176..4341bbe5c1 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -573,7 +573,7 @@ PHP_FUNCTION(mcrypt_generic_init)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Key size too large; supplied length: %d, max: %d", key_len, max_key_size);
key_size = max_key_size;
} else {
- key_size = key_len;
+ key_size = (int)key_len;
}
memcpy(key_s, key, key_len);
@@ -636,12 +636,12 @@ PHP_FUNCTION(mcrypt_generic)
/* Check blocksize */
if (mcrypt_enc_is_block_mode(pm->td) == 1) { /* It's a block algorithm */
block_size = mcrypt_enc_get_block_size(pm->td);
- data_size = (((data_len - 1) / block_size) + 1) * block_size;
+ data_size = ((((int)data_len - 1) / block_size) + 1) * block_size;
data_s = emalloc(data_size + 1);
memset(data_s, 0, data_size);
memcpy(data_s, data, data_len);
} else { /* It's not a block algorithm */
- data_size = data_len;
+ data_size = (int)data_len;
data_s = emalloc(data_size + 1);
memset(data_s, 0, data_size);
memcpy(data_s, data, data_len);
@@ -681,12 +681,12 @@ PHP_FUNCTION(mdecrypt_generic)
/* Check blocksize */
if (mcrypt_enc_is_block_mode(pm->td) == 1) { /* It's a block algorithm */
block_size = mcrypt_enc_get_block_size(pm->td);
- data_size = (((data_len - 1) / block_size) + 1) * block_size;
+ data_size = ((((int)data_len - 1) / block_size) + 1) * block_size;
data_s = emalloc(data_size + 1);
memset(data_s, 0, data_size);
memcpy(data_s, data, data_len);
} else { /* It's not a block algorithm */
- data_size = data_len;
+ data_size = (int)data_len;
data_s = emalloc(data_size + 1);
memset(data_s, 0, data_size);
memcpy(data_s, data, data_len);
@@ -1238,7 +1238,7 @@ static int php_mcrypt_ensure_valid_iv(MCRYPT td, const char *iv, int iv_size TSR
}
/* }}} */
-static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, const char *data, int data_len, char *mode, const char *iv, size_t iv_len, size_t dencrypt, zval* return_value TSRMLS_DC) /* {{{ */
+static void php_mcrypt_do_crypt(char* cipher, const char *key, size_t key_len, const char *data, size_t data_len, char *mode, const char *iv, size_t iv_len, size_t dencrypt, zval* return_value TSRMLS_DC) /* {{{ */
{
char *cipher_dir_string;
char *module_dir_string;
@@ -1254,12 +1254,12 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, cons
RETURN_FALSE;
}
- if (php_mcrypt_ensure_valid_key_size(td, key_len TSRMLS_CC) == FAILURE) {
+ if (php_mcrypt_ensure_valid_key_size(td, (int)key_len TSRMLS_CC) == FAILURE) {
mcrypt_module_close(td);
RETURN_FALSE;
}
- if (php_mcrypt_ensure_valid_iv(td, iv, iv_len TSRMLS_CC) == FAILURE) {
+ if (php_mcrypt_ensure_valid_iv(td, iv, (int)iv_len TSRMLS_CC) == FAILURE) {
mcrypt_module_close(td);
RETURN_FALSE;
}
@@ -1267,7 +1267,7 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, cons
/* Check blocksize */
if (mcrypt_enc_is_block_mode(td) == 1) { /* It's a block algorithm */
int block_size = mcrypt_enc_get_block_size(td);
- data_size = (((data_len - 1) / block_size) + 1) * block_size;
+ data_size = ((((zend_long)data_len - 1) / block_size) + 1) * block_size;
data_s = emalloc(data_size + 1);
memset(data_s, 0, data_size);
memcpy(data_s, data, data_len);
@@ -1277,16 +1277,16 @@ static void php_mcrypt_do_crypt(char* cipher, const char *key, int key_len, cons
memcpy(data_s, data, data_len);
}
- if (mcrypt_generic_init(td, (void *) key, key_len, (void *) iv) < 0) {
+ if (mcrypt_generic_init(td, (void *) key, (int)key_len, (void *) iv) < 0) {
php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Mcrypt initialisation failed");
mcrypt_module_close(td);
RETURN_FALSE;
}
if (dencrypt == MCRYPT_ENCRYPT) {
- mcrypt_generic(td, data_s, data_size);
+ mcrypt_generic(td, data_s, (int)data_size);
} else {
- mdecrypt_generic(td, data_s, data_size);
+ mdecrypt_generic(td, data_s, (int)data_size);
}
data_s[data_size] = 0;
@@ -1424,7 +1424,7 @@ PHP_FUNCTION(mcrypt_create_iv)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not gather sufficient random data");
RETURN_FALSE;
}
- n = size;
+ n = (int)size;
#else
int fd;
size_t read_bytes = 0;
@@ -1451,7 +1451,7 @@ PHP_FUNCTION(mcrypt_create_iv)
}
#endif
} else {
- n = size;
+ n = (int)size;
while (size) {
iv[--size] = (char) (255.0 * php_rand(TSRMLS_C) / RAND_MAX);
}
diff --git a/ext/mcrypt/mcrypt_filter.c b/ext/mcrypt/mcrypt_filter.c
index 26f3dceba7..c36e9494e3 100644
--- a/ext/mcrypt/mcrypt_filter.c
+++ b/ext/mcrypt/mcrypt_filter.c
@@ -60,7 +60,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
if (data->blocksize) {
/* Blockmode cipher */
char *outchunk;
- int chunklen = bucket->buflen + data->block_used, n;
+ int chunklen = (int)(bucket->buflen + data->block_used), n;
php_stream_bucket *newbucket;
outchunk = pemalloc(chunklen, data->persistent);
@@ -91,9 +91,9 @@ static php_stream_filter_status_t php_mcrypt_filter(
/* Stream cipher */
php_stream_bucket_make_writeable(bucket TSRMLS_CC);
if (data->encrypt) {
- mcrypt_generic(data->module, bucket->buf, bucket->buflen);
+ mcrypt_generic(data->module, bucket->buf, (int)bucket->buflen);
} else {
- mdecrypt_generic(data->module, bucket->buf, bucket->buflen);
+ mdecrypt_generic(data->module, bucket->buf, (int)bucket->buflen);
}
php_stream_bucket_append(buckets_out, bucket TSRMLS_CC);
@@ -201,13 +201,13 @@ static php_stream_filter *php_mcrypt_filter_create(const char *filtername, zval
if ((tmpzval = zend_hash_str_find(HASH_OF(filterparams), ZEND_STRL("key"))) &&
Z_TYPE_P(tmpzval) == IS_STRING) {
key = Z_STRVAL_P(tmpzval);
- key_len = Z_STRLEN_P(tmpzval);
+ key_len = (int)Z_STRLEN_P(tmpzval);
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "key not specified or is not a string");
return NULL;
}
- mcrypt_module = mcrypt_module_open(cipher, algo_dir, mode, mode_dir);
+ mcrypt_module = mcrypt_module_open((char *)cipher, algo_dir, mode, mode_dir);
if (mcrypt_module == MCRYPT_FAILED) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open encryption module");
return NULL;
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index 41f34e366a..08a10dbbd1 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -1306,7 +1306,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
stream = (*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC);
DBG_INF_FMT("conn=%llu stream=%p", (*p)->data->thread_id, stream);
if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
- (void*)&this_fd, 1) && this_fd >= 0) {
+ (void*)&this_fd, 1) && ZEND_VALID_SOCKET(this_fd)) {
PHP_SAFE_FD_SET(this_fd, fds);
@@ -1336,7 +1336,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds
stream = (*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC);
DBG_INF_FMT("conn=%llu stream=%p", (*fwd)->data->thread_id, stream);
if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
- (void*)&this_fd, 1) && this_fd >= 0) {
+ (void*)&this_fd, 1) && ZEND_VALID_SOCKET(this_fd)) {
if (PHP_SAFE_FD_ISSET(this_fd, fds)) {
if (disproportion) {
*bckwd = *fwd;
diff --git a/ext/opcache/Optimizer/optimize_func_calls.c b/ext/opcache/Optimizer/optimize_func_calls.c
index aa62a4542d..9031a38f56 100644
--- a/ext/opcache/Optimizer/optimize_func_calls.c
+++ b/ext/opcache/Optimizer/optimize_func_calls.c
@@ -143,8 +143,6 @@ void optimize_func_calls(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRMLS
if (!(opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) && call_stack[call - 1].func) {
if (ARG_SHOULD_BE_SENT_BY_REF(call_stack[call - 1].func, opline->op2.num)) {
opline->extended_value |= ZEND_ARG_COMPILE_TIME_BOUND | ZEND_ARG_SEND_BY_REF;
- } else if (opline->extended_value) {
- opline->extended_value |= ZEND_ARG_COMPILE_TIME_BOUND;
} else {
opline->opcode = ZEND_SEND_VAR;
opline->extended_value = 0;
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index b91ac5b50f..15bca2adf8 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -341,28 +341,75 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
}
break;
- case ZEND_INIT_FCALL:
+ case ZEND_DO_FCALL: {
+ zend_op *send1_opline = opline - 1;
+ zend_op *send2_opline = NULL;
+ zend_op *init_opline = NULL;
+
+ while (send1_opline->opcode == ZEND_NOP) {
+ send1_opline--;
+ }
+ if (send1_opline->opcode != ZEND_SEND_VAL ||
+ ZEND_OP1_TYPE(send1_opline) != IS_CONST) {
+ /* don't colllect constants after unknown function call */
+ collect_constants = 0;
+ break;
+ }
+ if (send1_opline->op2.num == 2) {
+ send2_opline = send1_opline;
+ send1_opline--;
+ while (send1_opline->opcode == ZEND_NOP) {
+ send1_opline--;
+ }
+ if (send1_opline->opcode != ZEND_SEND_VAL ||
+ ZEND_OP1_TYPE(send1_opline) != IS_CONST) {
+ /* don't colllect constants after unknown function call */
+ collect_constants = 0;
+ break;
+ }
+ }
+ init_opline = send1_opline - 1;
+ while (init_opline->opcode == ZEND_NOP) {
+ init_opline--;
+ }
+ if (init_opline->opcode != ZEND_INIT_FCALL ||
+ ZEND_OP2_TYPE(init_opline) != IS_CONST ||
+ Z_TYPE(ZEND_OP2_LITERAL(init_opline)) != IS_STRING) {
+ /* don't colllect constants after unknown function call */
+ collect_constants = 0;
+ break;
+ }
+
/* define("name", scalar); */
- if (collect_constants &&
- ZEND_OP2_TYPE(opline) == IS_CONST &&
- Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING &&
- Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("define")-1 &&
- zend_binary_strcasecmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)), Z_STRLEN(ZEND_OP2_LITERAL(opline)), "define", sizeof("define")-1) == 0) {
+ if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("define")-1 &&
+ zend_binary_strcasecmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)), Z_STRLEN(ZEND_OP2_LITERAL(init_opline)), "define", sizeof("define")-1) == 0) {
- if ((opline+1)->opcode == ZEND_SEND_VAL &&
- ZEND_OP1_TYPE(opline+1) == IS_CONST &&
- Z_TYPE(ZEND_OP1_LITERAL(opline+1)) == IS_STRING &&
- (opline+2)->opcode == ZEND_SEND_VAL &&
- ZEND_OP1_TYPE(opline+2) == IS_CONST &&
- Z_TYPE(ZEND_OP1_LITERAL(opline+2)) <= IS_STRING &&
- (opline+3)->opcode == ZEND_DO_FCALL) {
-
- zend_optimizer_collect_constant(ctx, &ZEND_OP1_LITERAL(opline+1), &ZEND_OP1_LITERAL(opline+2));
+ if (Z_TYPE(ZEND_OP1_LITERAL(send1_opline)) == IS_STRING &&
+ send2_opline &&
+ Z_TYPE(ZEND_OP1_LITERAL(send2_opline)) <= IS_STRING) {
+
+ if (collect_constants) {
+ zend_optimizer_collect_constant(ctx, &ZEND_OP1_LITERAL(send1_opline), &ZEND_OP1_LITERAL(send2_opline));
+ }
+
+ if (RESULT_UNUSED(opline) &&
+ !zend_memnstr(Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), "::", sizeof("::") - 1, Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)) + Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)))) {
+
+ opline->opcode = ZEND_DECLARE_CONST;
+ opline->op1_type = IS_CONST;
+ opline->op2_type = IS_CONST;
+ opline->result_type = IS_UNUSED;
+ opline->op1.constant = send1_opline->op1.constant;
+ opline->op2.constant = send2_opline->op1.constant;
+ opline->result.zv = NULL;
+
+ literal_dtor(&ZEND_OP2_LITERAL(init_opline));
+ MAKE_NOP(init_opline);
+ MAKE_NOP(send1_opline);
+ MAKE_NOP(send2_opline);
+ }
break;
}
- } else {
- /* don't colllect constants after any other function call */
- collect_constants = 0;
}
/* pre-evaluate constant functions:
@@ -372,42 +419,42 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
is_callable(x)
extension_loaded(x)
*/
- if ((opline + 1)->opcode == ZEND_SEND_VAL &&
- (opline + 2)->opcode == ZEND_DO_FCALL &&
- ZEND_OP1_TYPE(opline + 1) == IS_CONST && Z_TYPE(ZEND_OP1_LITERAL(opline + 1)) == IS_STRING &&
- ZEND_OP2_TYPE(opline) == IS_CONST && Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) {
- if ((Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("function_exists")-1 &&
- !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)),
+ if (!send2_opline &&
+ Z_TYPE(ZEND_OP1_LITERAL(send1_opline)) == IS_STRING) {
+ if ((Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("function_exists")-1 &&
+ !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
"function_exists", sizeof("function_exists")-1)) ||
- (Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("is_callable")-1 &&
- !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)),
+ (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("is_callable")-1 &&
+ !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
"is_callable", sizeof("is_callable")))) {
zend_internal_function *func;
char *lc_name = zend_str_tolower_dup(
- Z_STRVAL(ZEND_OP1_LITERAL(opline + 1)), Z_STRLEN(ZEND_OP1_LITERAL(opline + 1)));
+ Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)));
- if ((func = zend_hash_str_find_ptr(EG(function_table), lc_name, Z_STRLEN(ZEND_OP1_LITERAL(opline + 1)))) != NULL &&
+ if ((func = zend_hash_str_find_ptr(EG(function_table), lc_name, Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)))) != NULL &&
func->type == ZEND_INTERNAL_FUNCTION &&
func->module->type == MODULE_PERSISTENT) {
zval t;
ZVAL_BOOL(&t, 1);
- if (zend_optimizer_replace_by_const(op_array, opline + 3, IS_VAR, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) {
- literal_dtor(&ZEND_OP2_LITERAL(opline));
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ literal_dtor(&ZEND_OP2_LITERAL(init_opline));
+ MAKE_NOP(init_opline);
+ literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
+ MAKE_NOP(send1_opline);
MAKE_NOP(opline);
- literal_dtor(&ZEND_OP1_LITERAL(opline + 1));
- MAKE_NOP(opline + 1);
- MAKE_NOP(opline + 2);
+ efree(lc_name);
+ break;
}
}
efree(lc_name);
- } else if (Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("extension_loaded")-1 &&
- !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)),
+ } else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("extension_loaded")-1 &&
+ !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
"extension_loaded", sizeof("extension_loaded")-1)) {
zval t;
char *lc_name = zend_str_tolower_dup(
- Z_STRVAL(ZEND_OP1_LITERAL(opline + 1)), Z_STRLEN(ZEND_OP1_LITERAL(opline + 1)));
+ Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)));
zend_module_entry *m = zend_hash_str_find_ptr(&module_registry,
- lc_name, Z_STRLEN(ZEND_OP1_LITERAL(opline + 1)));
+ lc_name, Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)));
efree(lc_name);
if (!m) {
@@ -424,60 +471,89 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
}
}
- if (zend_optimizer_replace_by_const(op_array, opline + 3, IS_VAR, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) {
- literal_dtor(&ZEND_OP2_LITERAL(opline));
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ literal_dtor(&ZEND_OP2_LITERAL(init_opline));
+ MAKE_NOP(init_opline);
+ literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
+ MAKE_NOP(send1_opline);
MAKE_NOP(opline);
- literal_dtor(&ZEND_OP1_LITERAL(opline + 1));
- MAKE_NOP(opline + 1);
- MAKE_NOP(opline + 2);
+ break;
}
- } else if (Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("defined")-1 &&
- !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)),
+ } else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("defined")-1 &&
+ !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
"defined", sizeof("defined")-1)) {
zval t;
- if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline + 1)), &t, 0 TSRMLS_CC)) {
+ if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 0 TSRMLS_CC)) {
ZVAL_BOOL(&t, 1);
- if (zend_optimizer_replace_by_const(op_array, opline + 3, IS_VAR, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) {
- literal_dtor(&ZEND_OP2_LITERAL(opline));
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ literal_dtor(&ZEND_OP2_LITERAL(init_opline));
+ MAKE_NOP(init_opline);
+ literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
+ MAKE_NOP(send1_opline);
MAKE_NOP(opline);
- literal_dtor(&ZEND_OP1_LITERAL(opline + 1));
- MAKE_NOP(opline + 1);
- MAKE_NOP(opline + 2);
+ break;
}
}
- } else if (Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("constant")-1 &&
- !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)),
+ } else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("constant")-1 &&
+ !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
"constant", sizeof("constant")-1)) {
zval t;
- if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(opline + 1)), &t, 1 TSRMLS_CC)) {
- if (zend_optimizer_replace_by_const(op_array, opline + 3, IS_VAR, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) {
- literal_dtor(&ZEND_OP2_LITERAL(opline));
+ if (zend_optimizer_get_persistent_constant(Z_STR(ZEND_OP1_LITERAL(send1_opline)), &t, 1 TSRMLS_CC)) {
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ literal_dtor(&ZEND_OP2_LITERAL(init_opline));
+ MAKE_NOP(init_opline);
+ literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
+ MAKE_NOP(send1_opline);
MAKE_NOP(opline);
- literal_dtor(&ZEND_OP1_LITERAL(opline + 1));
- MAKE_NOP(opline + 1);
- MAKE_NOP(opline + 2);
+ break;
}
}
} else if ((CG(compiler_options) & ZEND_COMPILE_NO_BUILTIN_STRLEN) == 0 &&
- Z_STRLEN(ZEND_OP2_LITERAL(opline)) == sizeof("strlen")-1 &&
- !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(opline)),
+ Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("strlen")-1 &&
+ !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
"strlen", sizeof("strlen")-1)) {
zval t;
- ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(opline + 1)));
- if (zend_optimizer_replace_by_const(op_array, opline + 3, IS_VAR, ZEND_RESULT(opline + 2).var, &t TSRMLS_CC)) {
- literal_dtor(&ZEND_OP2_LITERAL(opline));
+ ZVAL_LONG(&t, Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)));
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ literal_dtor(&ZEND_OP2_LITERAL(init_opline));
+ MAKE_NOP(init_opline);
+ literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
+ MAKE_NOP(send1_opline);
MAKE_NOP(opline);
- literal_dtor(&ZEND_OP1_LITERAL(opline + 1));
- MAKE_NOP(opline + 1);
- MAKE_NOP(opline + 2);
+ break;
+ }
+ /* dirname(IS_CONST/IS_STRING) -> IS_CONST/IS_STRING */
+ } else if (Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("dirname")-1 &&
+ !memcmp(Z_STRVAL(ZEND_OP2_LITERAL(init_opline)),
+ "dirname", sizeof("dirname")-1) &&
+ IS_ABSOLUTE_PATH(Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)))) {
+ zend_string *dirname = zend_string_init(Z_STRVAL(ZEND_OP1_LITERAL(send1_opline)), Z_STRLEN(ZEND_OP1_LITERAL(send1_opline)), 0);
+ dirname->len = zend_dirname(dirname->val, dirname->len);
+ if (IS_ABSOLUTE_PATH(dirname->val, dirname->len)) {
+ zval t;
+
+ ZVAL_STR(&t, dirname);
+ if (zend_optimizer_replace_by_const(op_array, opline + 1, IS_VAR, ZEND_RESULT(opline).var, &t TSRMLS_CC)) {
+ literal_dtor(&ZEND_OP2_LITERAL(init_opline));
+ MAKE_NOP(init_opline);
+ literal_dtor(&ZEND_OP1_LITERAL(send1_opline));
+ MAKE_NOP(send1_opline);
+ MAKE_NOP(opline);
+ break;
+ }
+ } else {
+ zend_string_release(dirname);
}
}
}
+ /* don't colllect constants after any other function call */
+ collect_constants = 0;
break;
+ }
case ZEND_STRLEN:
if (ZEND_OP1_TYPE(opline) == IS_CONST &&
Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING) {
@@ -530,7 +606,6 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML
case ZEND_FE_RESET:
case ZEND_FE_FETCH:
case ZEND_NEW:
- case ZEND_DO_FCALL:
case ZEND_JMP_SET:
case ZEND_COALESCE:
collect_constants = 0;
diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c
index 1a6d0b675a..589028368f 100644
--- a/ext/opcache/Optimizer/zend_optimizer.c
+++ b/ext/opcache/Optimizer/zend_optimizer.c
@@ -283,6 +283,14 @@ int zend_optimizer_replace_by_const(zend_op_array *op_array,
case ZEND_ASSIGN_DIM:
case ZEND_SEPARATE:
return 0;
+ case ZEND_SEND_VAR:
+ opline->extended_value = 0;
+ opline->opcode = ZEND_SEND_VAL;
+ break;
+ case ZEND_SEND_VAR_EX:
+ opline->extended_value = 0;
+ opline->opcode = ZEND_SEND_VAL_EX;
+ break;
case ZEND_SEND_VAR_NO_REF:
if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) {
if (opline->extended_value & ZEND_ARG_SEND_BY_REF) {
diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c
index 6f37146a91..42117ae1b7 100644
--- a/ext/opcache/ZendAccelerator.c
+++ b/ext/opcache/ZendAccelerator.c
@@ -878,12 +878,12 @@ static inline int do_validate_timestamps(zend_persistent_script *persistent_scri
int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle TSRMLS_DC)
{
if (ZCG(accel_directives).revalidate_freq &&
- (persistent_script->dynamic_members.revalidate >= ZCSG(revalidate_at))) {
+ persistent_script->dynamic_members.revalidate >= ZCG(request_time)) {
return SUCCESS;
} else if (do_validate_timestamps(persistent_script, file_handle TSRMLS_CC) == FAILURE) {
return FAILURE;
} else {
- persistent_script->dynamic_members.revalidate = ZCSG(revalidate_at);
+ persistent_script->dynamic_members.revalidate = ZCG(request_time) + ZCG(accel_directives).revalidate_freq;
return SUCCESS;
}
}
@@ -1424,7 +1424,7 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han
* otherwise we have a race-condition.
*/
new_persistent_script->timestamp = timestamp;
- new_persistent_script->dynamic_members.revalidate = ZCSG(revalidate_at);
+ new_persistent_script->dynamic_members.revalidate = ZCG(request_time) + ZCG(accel_directives).revalidate_freq;
}
if (file_handle->opened_path) {
@@ -1894,13 +1894,6 @@ static void accel_activate(void)
zend_accel_error(ACCEL_LOG_WARNING, "Internal functions count changed - was %d, now %d", ZCG(internal_functions_count), zend_hash_num_elements(&ZCG(function_table)));
}
- if (ZCG(accel_directives).validate_timestamps) {
- time_t now = ZCG(request_time);
- if (now > ZCSG(revalidate_at) + (time_t)ZCG(accel_directives).revalidate_freq) {
- ZCSG(revalidate_at) = now;
- }
- }
-
ZCG(cwd) = NULL;
SHM_PROTECT();
@@ -2353,10 +2346,6 @@ static int accel_startup(zend_extension *extension)
accelerator_orig_zend_resolve_path = zend_resolve_path;
zend_resolve_path = persistent_zend_resolve_path;
- if (ZCG(accel_directives).validate_timestamps) {
- ZCSG(revalidate_at) = zend_accel_get_time() + ZCG(accel_directives).revalidate_freq;
- }
-
/* Override chdir() function */
if ((func = zend_hash_str_find_ptr(CG(function_table), "chdir", sizeof("chdir")-1)) != NULL &&
func->type == ZEND_INTERNAL_FUNCTION) {
diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h
index 066c957e9f..119148aa27 100644
--- a/ext/opcache/ZendAccelerator.h
+++ b/ext/opcache/ZendAccelerator.h
@@ -270,7 +270,6 @@ typedef struct _zend_accel_shared_globals {
LONGLONG restart_in;
#endif
zend_bool restart_in_progress;
- time_t revalidate_at;
/* Interned Strings Support */
char *interned_strings_start;
char *interned_strings_top;
diff --git a/ext/opcache/tests/bug68104.phpt b/ext/opcache/tests/bug68104.phpt
new file mode 100644
index 0000000000..8d3bf70a4d
--- /dev/null
+++ b/ext/opcache/tests/bug68104.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Bug #68104 (Segfault while pre-evaluating a disabled function)
+--CREDITS--
+manuel <manuel@mausz.at>
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+disable_functions=dl
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+var_dump(is_callable("dl"));
+dl("a.so");
+?>
+--EXPECTF--
+bool(true)
+
+Warning: dl() has been disabled for security reasons in %sbug68104.php on line %d
diff --git a/ext/opcache/tests/bug68252.phpt b/ext/opcache/tests/bug68252.phpt
new file mode 100644
index 0000000000..e05467a244
--- /dev/null
+++ b/ext/opcache/tests/bug68252.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #68252 (segfault in Zend/zend_hash.c in function _zend_hash_del_el)
+--INI--
+opcache.enable=1
+opcache.enable_cli=1
+opcache.fast_shutdown=1
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+/* run this test script with valgrind */
+function a() {
+ echo "okey";
+}
+
+create_function('', 'var_dump("22");');
+
+a();
+--EXPECT--
+okey
diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c
index 001c3ee9ed..fcaf96408c 100644
--- a/ext/opcache/zend_accelerator_module.c
+++ b/ext/opcache/zend_accelerator_module.c
@@ -499,7 +499,7 @@ static int accelerator_get_scripts(zval *return_value TSRMLS_DC)
timerclear(&exec_time);
timerclear(&fetch_time);
- zend_hash_str_update(Z_ARRVAL_P(return_value), cache_entry->key, cache_entry->key_length-1, &persistent_script_report);
+ zend_hash_str_update(Z_ARRVAL_P(return_value), cache_entry->key, cache_entry->key_length, &persistent_script_report);
}
}
accelerator_shm_read_unlock(TSRMLS_C);
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 67857da2c7..6f9f2aebbf 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -423,8 +423,8 @@ PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS
extra = pcre_study(re, soptions, &error);
if (extra) {
extra->flags |= PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION;
- extra->match_limit = PCRE_G(backtrack_limit);
- extra->match_limit_recursion = PCRE_G(recursion_limit);
+ extra->match_limit = (unsigned long)PCRE_G(backtrack_limit);
+ extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit);
}
if (error != NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while studying pattern");
@@ -568,14 +568,14 @@ static void php_do_pcre_match(INTERNAL_FUNCTION_PARAMETERS, int global) /* {{{ *
RETURN_FALSE;
}
- php_pcre_match_impl(pce, subject->val, subject->len, return_value, subpats,
+ php_pcre_match_impl(pce, subject->val, (int)subject->len, return_value, subpats,
global, ZEND_NUM_ARGS() >= 4, flags, start_offset TSRMLS_CC);
}
/* }}} */
/* {{{ php_pcre_match_impl() */
PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_DC)
+ zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset TSRMLS_DC)
{
zval result_set, /* Holds a set of subpatterns after
a global match */
@@ -640,8 +640,8 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION;
extra = &extra_data;
}
- extra->match_limit = PCRE_G(backtrack_limit);
- extra->match_limit_recursion = PCRE_G(recursion_limit);
+ extra->match_limit = (unsigned long)PCRE_G(backtrack_limit);
+ extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit);
#ifdef PCRE_EXTRA_MARK
extra->mark = &mark;
extra->flags |= PCRE_EXTRA_MARK;
@@ -668,7 +668,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
} else {
offsets = (int *)safe_emalloc(size_offsets, sizeof(int), 0);
}
-
+ memset(offsets, 0, size_offsets*sizeof(int));
/* Allocate match sets array and initialize the values. */
if (global && subpats && subpats_order == PREG_PATTERN_ORDER) {
match_sets = (zval *)safe_emalloc(num_subpats, sizeof(zval), 0);
@@ -682,7 +682,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
do {
/* Execute the regular expression. */
- count = pcre_exec(pce->re, extra, subject, subject_len, start_offset,
+ count = pcre_exec(pce->re, extra, subject, (int)subject_len, (int)start_offset,
exoptions|g_notempty, offsets, size_offsets);
/* the string was already proved to be valid UTF-8 */
@@ -834,8 +834,8 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec
the start offset, and continue. Fudge the offset values
to achieve this, unless we're already at the end of the string. */
if (g_notempty != 0 && start_offset < subject_len) {
- offsets[0] = start_offset;
- offsets[1] = start_offset + 1;
+ offsets[0] = (int)start_offset;
+ offsets[1] = (int)(start_offset + 1);
} else
break;
} else {
@@ -1130,8 +1130,8 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION;
extra = &extra_data;
}
- extra->match_limit = PCRE_G(backtrack_limit);
- extra->match_limit_recursion = PCRE_G(recursion_limit);
+ extra->match_limit = (unsigned long)PCRE_G(backtrack_limit);
+ extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit);
eval = pce->preg_options & PREG_REPLACE_EVAL;
if (is_callable_replace) {
@@ -1141,7 +1141,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
}
} else {
replace = Z_STRVAL_P(replace_val);
- replace_len = Z_STRLEN_P(replace_val);
+ replace_len = (int)Z_STRLEN_P(replace_val);
replace_end = replace + replace_len;
}
@@ -1212,11 +1212,11 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
if (eval) {
eval_result = preg_do_eval(replace, replace_len, subject,
offsets, count TSRMLS_CC);
- new_len += eval_result->len;
+ new_len += (int)eval_result->len;
} else if (is_callable_replace) {
/* Use custom function to get replacement string and its length. */
eval_result = preg_do_repl_func(replace_val, subject, offsets, subpat_names, count, mark TSRMLS_CC);
- new_len += eval_result->len;
+ new_len += (int)eval_result->len;
} else { /* do regular substitution */
walk = replace;
walk_last = 0;
@@ -1245,7 +1245,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
}
/* copy the part of the string before the match */
memcpy(&result->val[result_len], piece, match-piece);
- result_len += match-piece;
+ result_len += (int)(match-piece);
/* copy replacement and backrefs */
walkbuf = result->val + result_len;
@@ -1254,7 +1254,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
* and clean up. */
if (eval || is_callable_replace) {
memcpy(walkbuf, eval_result->val, eval_result->len);
- result_len += eval_result->len;
+ result_len += (int)eval_result->len;
if (eval_result) zend_string_release(eval_result);
} else { /* do regular backreference copying */
walk = replace;
@@ -1280,7 +1280,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject,
}
*walkbuf = '\0';
/* increment the result length by how much we've added to the string */
- result_len += walkbuf - (result->val + result_len);
+ result_len += (int)(walkbuf - (result->val + result_len));
}
if (limit != -1)
@@ -1393,7 +1393,7 @@ static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *sub
for further replacements. */
if ((result = php_pcre_replace(regex_str,
subject_str->val,
- subject_str->len,
+ (int)subject_str->len,
replace_value,
is_callable_replace,
limit,
@@ -1413,7 +1413,7 @@ static zend_string *php_replace_in_subject(zval *regex, zval *replace, zval *sub
} else {
result = php_pcre_replace(Z_STR_P(regex),
subject_str->val,
- subject_str->len,
+ (int)subject_str->len,
replace,
is_callable_replace,
limit,
@@ -1477,7 +1477,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, int is_callable_repl
}
if (ZEND_NUM_ARGS() > 3) {
- limit_val = limit;
+ limit_val = (int)limit;
}
if (Z_TYPE_P(regex) != IS_ARRAY) {
@@ -1579,14 +1579,14 @@ static PHP_FUNCTION(preg_split)
RETURN_FALSE;
}
- php_pcre_split_impl(pce, subject->val, subject->len, return_value, limit_val, flags TSRMLS_CC);
+ php_pcre_split_impl(pce, subject->val, (int)subject->len, return_value, (int)limit_val, flags TSRMLS_CC);
}
/* }}} */
/* {{{ php_pcre_split
*/
PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- long limit_val, long flags TSRMLS_DC)
+ zend_long limit_val, zend_long flags TSRMLS_DC)
{
pcre_extra *extra = NULL; /* Holds results of studying */
pcre *re_bump = NULL; /* Regex instance for empty matches */
@@ -1617,8 +1617,8 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION;
extra = &extra_data;
}
- extra->match_limit = PCRE_G(backtrack_limit);
- extra->match_limit_recursion = PCRE_G(recursion_limit);
+ extra->match_limit = (unsigned long)PCRE_G(backtrack_limit);
+ extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit);
#ifdef PCRE_EXTRA_MARK
extra->flags &= ~PCRE_EXTRA_MARK;
#endif
@@ -1661,7 +1661,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
if (offset_capture) {
/* Add (match, offset) pair to the return value */
- add_offset_pair(return_value, last_match, &subject[offsets[0]]-last_match, next_offset, NULL);
+ add_offset_pair(return_value, last_match, (int)(&subject[offsets[0]]-last_match), next_offset, NULL);
} else {
/* Add the piece to the return value */
add_next_index_stringl(return_value, last_match,
@@ -1737,7 +1737,7 @@ PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subjec
}
- start_offset = last_match - subject; /* the offset might have been incremented, but without further successful matches */
+ start_offset = (int)(last_match - subject); /* the offset might have been incremented, but without further successful matches */
if (!no_empty || start_offset < subject_len)
{
@@ -1889,7 +1889,7 @@ static PHP_FUNCTION(preg_grep)
}
/* }}} */
-PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, long flags TSRMLS_DC) /* {{{ */
+PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, zend_long flags TSRMLS_DC) /* {{{ */
{
zval *entry; /* An entry in the input array */
pcre_extra *extra = pce->extra;/* Holds results of studying */
@@ -1909,8 +1909,8 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return
extra_data.flags = PCRE_EXTRA_MATCH_LIMIT | PCRE_EXTRA_MATCH_LIMIT_RECURSION;
extra = &extra_data;
}
- extra->match_limit = PCRE_G(backtrack_limit);
- extra->match_limit_recursion = PCRE_G(recursion_limit);
+ extra->match_limit = (unsigned long)PCRE_G(backtrack_limit);
+ extra->match_limit_recursion = (unsigned long)PCRE_G(recursion_limit);
#ifdef PCRE_EXTRA_MARK
extra->flags &= ~PCRE_EXTRA_MARK;
#endif
@@ -1934,7 +1934,7 @@ PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return
/* Perform the match */
count = pcre_exec(pce->re, extra, subject_str->val,
- subject_str->len, 0,
+ (int)subject_str->len, 0,
0, offsets, size_offsets);
/* Check for too many substrings condition. */
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index a7d69adbc6..5ed39deaea 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -57,21 +57,21 @@ typedef struct {
PHPAPI pcre_cache_entry* pcre_get_compiled_regex_cache(zend_string *regex TSRMLS_DC);
PHPAPI void php_pcre_match_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- zval *subpats, int global, int use_flags, long flags, long start_offset TSRMLS_DC);
+ zval *subpats, int global, int use_flags, zend_long flags, zend_long start_offset TSRMLS_DC);
PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
int is_callable_replace, int limit, int *replace_count TSRMLS_DC);
PHPAPI void php_pcre_split_impl( pcre_cache_entry *pce, char *subject, int subject_len, zval *return_value,
- long limit_val, long flags TSRMLS_DC);
+ zend_long limit_val, zend_long flags TSRMLS_DC);
PHPAPI void php_pcre_grep_impl( pcre_cache_entry *pce, zval *input, zval *return_value,
- long flags TSRMLS_DC);
+ zend_long flags TSRMLS_DC);
ZEND_BEGIN_MODULE_GLOBALS(pcre)
HashTable pcre_cache;
- long backtrack_limit;
- long recursion_limit;
+ zend_long backtrack_limit;
+ zend_long recursion_limit;
#ifdef PCRE_STUDY_JIT_COMPILE
zend_bool jit;
#endif
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 705d08bacf..dbc98c6e5f 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -2486,6 +2486,7 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
pdo_stmt_t *stmt = row->stmt;
int colno = -1;
zval zobj;
+ zend_long lval;
ZVAL_NULL(rv);
if (stmt) {
@@ -2493,6 +2494,11 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl
if (Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count) {
fetch_value(stmt, rv, Z_LVAL_P(member), NULL TSRMLS_CC);
}
+ } else if (Z_TYPE_P(member) == IS_STRING
+ && is_numeric_string_ex(Z_STRVAL_P(member), Z_STRLEN_P(member), &lval, NULL, 0, NULL) == IS_LONG) {
+ if (lval >= 0 && lval < stmt->column_count) {
+ fetch_value(stmt, rv, lval, NULL TSRMLS_CC);
+ }
} else {
convert_to_string(member);
/* TODO: replace this with a hash of available column names to column
@@ -2541,19 +2547,24 @@ static int row_prop_exists(zval *object, zval *member, int check_empty, void **c
pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object);
pdo_stmt_t *stmt = row->stmt;
int colno = -1;
+ zend_long lval;
if (stmt) {
if (Z_TYPE_P(member) == IS_LONG) {
return Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count;
+ } else if (Z_TYPE_P(member) == IS_STRING) {
+ if (is_numeric_string_ex(Z_STRVAL_P(member), Z_STRLEN_P(member), &lval, NULL, 0, NULL) == IS_LONG) {
+ return lval >=0 && lval < stmt->column_count;
+ }
} else {
convert_to_string(member);
+ }
- /* TODO: replace this with a hash of available column names to column
- * numbers */
- for (colno = 0; colno < stmt->column_count; colno++) {
- if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) {
- return 1;
- }
+ /* TODO: replace this with a hash of available column names to column
+ * numbers */
+ for (colno = 0; colno < stmt->column_count; colno++) {
+ if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) {
+ return 1;
}
}
}
diff --git a/ext/pdo_dblib/README b/ext/pdo_dblib/README
index 888ffb676f..15f8d147a0 100644
--- a/ext/pdo_dblib/README
+++ b/ext/pdo_dblib/README
@@ -1,25 +1,12 @@
This is the unified Sybase-DB style driver for PDO.
-There are three implementations of this library that are known to me:
-
-- The Sybase DB lib itself
-- MSSQL DB lib
-- FreeTDS DB lib
-
-This extension will compile and register itself as 'mssql' when built against
-the mssql libraries (and be named php_pdo_mssql.dll), or 'sybase' otherwise
-(php_pdo_sybase.dll)
-
-If you want to try out the free "desktop" version of SQL Server, known as the MSDE, google to obtain the appropriate download link. Here are some short tips on getting it running:
-
-- Download it and run it to extract it
-- Open up a command prompt
-- cd \MSDERelA
-- setup.exe SQLSECURITY=1 SAPWD=yoursecretpassword
-- cd \Program Files\Microsoft SQL Server\80\Tools\Binn
-- SVRNETCN.exe
-- enable TCP (you MUST do this if you want to access it via FreeTDS/Sybase libs)
-- net start mssqlserver
-
-Consult the MS docs for more information about all this stuff.
+This extension register itself as:
+ - 'mssql' when built against the Microsoft DBLIB library
+ - 'sybase' when built against Sybase ct-lib
+ - 'dblib' when built against FreeTDS
+The following database products are free for testing:
+ - Microsoft SQL Server Express (Windows Only)
+ - Sybase Adaptive Server (Windows, Linux, *NIX)
+ - Microsoft SQL Server Azure (One Month Trial Cloud Service)
+
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c
index 323c805fca..a433e8652c 100644
--- a/ext/pdo_dblib/dblib_driver.c
+++ b/ext/pdo_dblib/dblib_driver.c
@@ -144,30 +144,58 @@ static zend_long dblib_handle_doer(pdo_dbh_t *dbh, const char *sql, zend_long sq
static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquotedlen, char **quoted, int *quotedlen, enum pdo_param_type paramtype TSRMLS_DC)
{
+
+ int useBinaryEncoding = 0;
+ const char * hex = "0123456789abcdef";
+ int i;
+ char * q;
+ *quotedlen = 0;
- /* pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; */
+ /*
+ * Detect quoted length and if we should use binary encoding
+ */
+ for(i=0;i<unquotedlen;i++) {
+ if( 32 > unquoted[i] || 127 < unquoted[i] ) {
+ useBinaryEncoding = 1;
+ break;
+ }
+ if(unquoted[i] == '\'') ++*quotedlen;
+ ++*quotedlen;
+ }
- char *q;
- int l = 1;
-
- *quoted = q = safe_emalloc(2, unquotedlen, 3);
- *q++ = '\'';
-
- while (unquotedlen--) {
- if (*unquoted == '\'') {
- *q++ = '\'';
- *q++ = '\'';
- l += 2;
- } else {
- *q++ = *unquoted;
- ++l;
+ if(useBinaryEncoding) {
+ /*
+ * Binary safe quoting
+ * Will implicitly convert for all data types except Text, DateTime & SmallDateTime
+ *
+ */
+ *quotedlen = (unquotedlen * 2) + 2; /* 2 chars per byte +2 for "0x" prefix */
+ q = *quoted = emalloc(*quotedlen);
+
+ *q++ = '0';
+ *q++ = 'x';
+ for (i=0;i<unquotedlen;i++) {
+ *q++ = hex[ (*unquoted>>4)&0xF];
+ *q++ = hex[ (*unquoted++)&0xF];
+ }
+ } else {
+ /* Alpha/Numeric Quoting */
+ *quotedlen += 2; /* +2 for opening, closing quotes */
+ q = *quoted = emalloc(*quotedlen);
+ *q++ = '\'';
+
+ for (i=0;i<unquotedlen;i++) {
+ if (unquoted[i] == '\'') {
+ *q++ = '\'';
+ *q++ = '\'';
+ } else {
+ *q++ = unquoted[i];
+ }
}
- unquoted++;
+ *q++ = '\'';
}
- *q++ = '\'';
- *q++ = '\0';
- *quotedlen = l+1;
+ *q = 0;
return 1;
}
@@ -240,7 +268,7 @@ char *dblib_handle_last_id(pdo_dbh_t *dbh, const char *name, unsigned int *len T
}
id = emalloc(32);
- *len = dbconvert(NULL, (dbcoltype(H->link, 1)) , (dbdata(H->link, 1)) , (dbdatlen(H->link, 1)), SQLCHAR, id, (DBINT)-1);
+ *len = dbconvert(NULL, (dbcoltype(H->link, 1)) , (dbdata(H->link, 1)) , (dbdatlen(H->link, 1)), SQLCHAR, (BYTE *)id, (DBINT)-1);
dbcancel(H->link);
return id;
@@ -285,7 +313,6 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_
{
pdo_dblib_db_handle *H;
int i, nvars, nvers, ret = 0;
- int *val;
const pdo_dblib_keyval tdsver[] = {
{"4.2",DBVERSION_42}
diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c
index 5546d891d0..2d45152ad9 100644
--- a/ext/pdo_pgsql/pgsql_driver.c
+++ b/ext/pdo_pgsql/pgsql_driver.c
@@ -471,6 +471,15 @@ static int pdo_pgsql_check_liveness(pdo_dbh_t *dbh TSRMLS_DC)
}
/* }}} */
+static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC)
+{
+ pdo_pgsql_db_handle *H;
+
+ H = (pdo_pgsql_db_handle *)dbh->driver_data;
+
+ return PQtransactionStatus(H->server) > PQTRANS_IDLE;
+}
+
static int pdo_pgsql_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC)
{
pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data;
@@ -495,7 +504,15 @@ static int pgsql_handle_begin(pdo_dbh_t *dbh TSRMLS_DC)
static int pgsql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC)
{
- return pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC);
+ int ret = pdo_pgsql_transaction_cmd("COMMIT", dbh TSRMLS_CC);
+
+ /* When deferred constraints are used the commit could
+ fail, and a ROLLBACK implicitly ran. See bug #67462 */
+ if (!ret) {
+ dbh->in_txn = pgsql_handle_in_transaction(dbh TSRMLS_CC);
+ }
+
+ return ret;
}
static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
@@ -503,15 +520,6 @@ static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC)
return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC);
}
-static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC)
-{
- pdo_pgsql_db_handle *H;
-
- H = (pdo_pgsql_db_handle *)dbh->driver_data;
-
- return PQtransactionStatus(H->server);
-}
-
/* {{{ proto string PDO::pgsqlCopyFromArray(string $table_name , array $rows [, string $delimiter [, string $null_as ] [, string $fields])
Returns true if the copy worked fine or false if error */
static PHP_METHOD(PDO, pgsqlCopyFromArray)
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index 05b8f79b27..49fbc63745 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -301,7 +301,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
if (param->paramno >= 0) {
zval *parameter;
- if (param->paramno > zend_hash_num_elements(stmt->bound_param_map)) {
+ if (param->paramno >= zend_hash_num_elements(stmt->bound_param_map)) {
pdo_pgsql_error_stmt(stmt, PGRES_FATAL_ERROR, "HY105");
return 0;
}
@@ -376,15 +376,10 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *
/* We need to manually convert to a pg native boolean value */
if (PDO_PARAM_TYPE(param->param_type) == PDO_PARAM_BOOL &&
((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) {
- zval *parameter;
- if (Z_ISREF(param->parameter)) {
- parameter = Z_REFVAL(param->parameter);
- } else {
- parameter = &param->parameter;
- }
SEPARATE_ZVAL(&param->parameter);
param->param_type = PDO_PARAM_STR;
- ZVAL_STRINGL(parameter, Z_TYPE_P(parameter) == IS_TRUE ? "t" : "f", 1);
+ convert_to_boolean(&param->parameter);
+ ZVAL_STRINGL(&param->parameter, Z_TYPE_P(&param->parameter) == IS_TRUE ? "t" : "f", 1);
}
}
return 1;
diff --git a/ext/pdo_pgsql/tests/bug62593.phpt b/ext/pdo_pgsql/tests/bug62593.phpt
index e3ebf46ed5..4ab4566f00 100644
--- a/ext/pdo_pgsql/tests/bug62593.phpt
+++ b/ext/pdo_pgsql/tests/bug62593.phpt
@@ -34,6 +34,19 @@ $query->execute();
$errors[] = $query->errorInfo();
var_dump($value);
+// Try with strings - Bug #68351
+$value = '0';
+$query->bindParam(':foo', $value, PDO::PARAM_BOOL);
+$query->execute();
+$errors[] = $query->errorInfo();
+var_dump($query->fetchColumn());
+
+$value = "abc";
+$query->bindParam(':foo', $value, PDO::PARAM_BOOL);
+$query->execute();
+$errors[] = $query->errorInfo();
+var_dump($query->fetchColumn());
+
$expect = 'No errors found';
foreach ($errors as $error)
@@ -48,4 +61,6 @@ echo $expect;
--EXPECTF--
bool(true)
bool(false)
+bool(true)
+bool(false)
No errors found
diff --git a/ext/pdo_pgsql/tests/bug66584.phpt b/ext/pdo_pgsql/tests/bug66584.phpt
new file mode 100644
index 0000000000..07742bca79
--- /dev/null
+++ b/ext/pdo_pgsql/tests/bug66584.phpt
@@ -0,0 +1,66 @@
+--TEST--
+PDO PgSQL Bug #66584 (Segmentation fault on statement deallocation)
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
+require dirname(__FILE__) . '/config.inc';
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$pdo = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+
+$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
+
+$pdo->beginTransaction();
+
+$pdo->query("CREATE TABLE b66584 (a int)");
+$pdo->query("INSERT INTO b66584 VALUES (165)");
+
+for ($i = 1; $i >= 0; $i--) {
+ $pdo->setAttribute(\PDO::ATTR_EMULATE_PREPARES, (bool)$i);
+
+ try {
+ run($pdo, [0 => 1, 2 => 165, 5 => 3]);
+ } catch (\Exception $e) {
+ var_dump($e->getMessage());
+ }
+
+ try {
+ run($pdo, json_decode('{"0":234,"1":165,"2":221,"3":207,"4":188,"5":216,"6":1150,"7":916,"8":967,"9":987,"10":951,"11":990,"12":959,"13":896,"14":947,"15":877,"16":1000,"17":1023,"18":904,"19":856,"20":860,"21":866,"22":930,"23":974,"24":1032,"25":1016,"26":1050,"27":1059,"28":1040,"29":1064,"30":1004,"31":214,"32":189,"33":166,"34":1002,"35":167,"36":191,"37":859,"38":204,"39":181,"40":1001,"42":208,"43":198,"44":177,"45":1003,"46":858,"47":190,"48":162,"49":210,"50":171,"51":197,"52":168,"53":194,"54":209,"55":200,"56":192,"57":180,"58":232,"59":222,"60":163,"61":196,"62":217,"64":176,"65":193,"66":172,"67":195,"68":170,"69":173,"70":233,"71":223,"72":218,"73":186,"74":175,"75":224,"76":205,"77":211,"78":235,"79":1101,"80":225,"81":236,"82":1102,"83":1164,"84":1083,"85":1005,"86":861,"87":1179,"88":960,"89":991,"90":1187,"91":880,"92":1149,"93":1033,"94":931,"95":1006,"96":862,"97":1151,"98":917,"99":881,"100":1148,"101":1065,"102":867,"103":952,"104":1152,"105":918,"106":961,"107":1180,"108":992,"109":1188,"110":932,"111":933,"112":968,"113":868,"114":882,"115":1147,"116":1017,"117":1131,"118":1174,"119":1178,"120":1186,"121":869,"122":1051,"123":934,"124":969,"125":975,"126":1066,"127":237,"128":953,"129":1024,"130":1146,"131":883,"132":1145,"133":884,"134":885,"135":1144,"136":886,"137":1143,"138":1025,"139":897,"140":898,"141":899,"142":1026,"143":1142,"144":887,"145":1141,"146":888,"147":889,"148":1140,"149":1189,"150":993,"151":1139,"152":890,"153":1138,"154":891,"155":900,"156":892,"157":1137,"158":1027,"159":901,"160":1136,"161":893,"162":870,"163":1052,"164":954,"165":1041,"166":1018,"167":1165,"168":1084,"169":962,"170":1181,"171":994,"172":1190,"173":1042,"174":935,"175":226,"176":871,"177":1191,"178":995,"179":977,"180":948,"181":1175,"182":1053,"183":955,"184":1182,"185":963,"186":1067,"187":919,"188":1153,"189":920,"190":1154,"191":1055,"192":1054,"193":1056,"194":863,"195":872,"196":1028,"197":921,"198":1155,"199":936,"200":970,"201":1019,"202":1166,"203":1085,"204":1135,"205":894,"206":1034,"207":905,"208":873,"209":937,"210":902,"211":1029,"212":1007,"213":864,"214":1043,"215":1057,"216":956,"217":957,"218":939,"219":1086,"220":1167,"221":1087,"222":1168,"223":1173,"224":1108,"225":978,"226":1044,"227":1183,"228":964,"229":965,"230":1184,"231":1045,"232":874,"233":940,"234":1046,"235":979,"236":903,"237":980,"238":1156,"239":922,"240":1035,"241":906,"242":971,"243":972,"244":878,"245":1134,"246":879,"247":1133,"248":907,"249":1036,"250":908,"251":1132,"252":895,"253":909,"254":1060,"255":981,"256":1068,"257":996,"258":1192,"259":941,"260":865,"261":1008,"262":910,"263":997,"264":1193,"265":982,"266":942,"267":1020,"268":983,"269":1061,"270":949,"271":1176,"272":875,"273":911,"274":1069,"275":1157,"276":923,"277":1158,"278":924,"279":988,"280":984,"281":925,"282":1159,"283":1062,"284":1047,"285":1194,"286":998,"287":1021,"288":1030,"289":1031,"290":1070,"291":1088,"292":1169,"293":958,"294":1195,"295":999,"296":966,"297":1185,"298":944,"299":945,"300":1022,"301":1103,"302":220,"303":1099,"304":1048,"305":927,"306":1161,"307":989,"308":973,"309":1071,"310":1074,"311":1072,"312":1073,"313":912,"314":1037,"315":913,"316":914,"317":1177,"318":950,"319":1049,"320":876,"321":985,"322":915,"323":1038,"324":946,"325":1089,"326":1170,"327":1090,"328":1171,"329":1091,"330":1172,"331":1063,"332":986,"333":928,"334":1162,"335":929,"336":1163,"337":976,"338":231,"339":201,"340":1098,"341":215}', true));
+ } catch (\Exception $e) {
+ var_dump($e->getMessage());
+ }
+}
+
+try {
+ $pdo->query("DROP TABLE b66584");
+ $pdo->rollback();
+} catch (\Exception $e) {
+}
+
+function run($pdo, $data)
+{
+ $bind = join(', ', array_fill(0, count($data), '?'));
+
+ $stmt = $pdo->prepare("SELECT COUNT(*) FROM b66584 WHERE a IN ({$bind})");
+
+ var_dump(count($data));
+
+ $stmt->execute($data);
+
+ var_dump($stmt->fetchColumn());
+}
+
+?>
+--EXPECTF--
+int(3)
+string(%d) "SQLSTATE%s"
+int(340)
+string(%d) "SQLSTATE%s"
+int(3)
+string(%d) "SQLSTATE%s"
+int(340)
+string(%d) "SQLSTATE%s"
diff --git a/ext/pdo_pgsql/tests/bug67462.phpt b/ext/pdo_pgsql/tests/bug67462.phpt
new file mode 100644
index 0000000000..888b19c248
--- /dev/null
+++ b/ext/pdo_pgsql/tests/bug67462.phpt
@@ -0,0 +1,34 @@
+--TEST--
+PDO PgSQL Bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception when not in transaction)
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
+require dirname(__FILE__) . '/config.inc';
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+PDOTest::skip();
+?>
+--FILE--
+<?php
+
+require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
+$pdo = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
+$pdo->setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
+
+$pdo->beginTransaction();
+
+try {
+ $pdo->query("CREATE TABLE b67462 (a int NOT NULL PRIMARY KEY DEFERRABLE INITIALLY DEFERRED)");
+ $pdo->query("INSERT INTO b67462 VALUES (1), (1)");
+
+ var_dump($pdo->inTransaction());
+ $pdo->commit(); // This should fail!
+} catch (\Exception $e) {
+ var_dump($pdo->inTransaction());
+ var_dump($pdo->beginTransaction());
+}
+
+?>
+--EXPECT--
+bool(true)
+bool(false)
+bool(true)
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index 3645e0a897..63cca9fc1c 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -87,6 +87,7 @@
#endif
#define CHECK_DEFAULT_LINK(x) if ((x) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "No PostgreSQL link opened yet"); }
+#define FETCH_DEFAULT_LINK() PGG(default_link) ? (int)PGG(default_link)->handle : -1
#ifndef HAVE_PQFREEMEM
#define PQfreemem free
@@ -1278,7 +1279,8 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
PGconn *pgsql;
smart_str str = {0};
zval *args;
- int i, connect_type = 0;
+ uint32_t i;
+ int connect_type = 0;
PGresult *pg_result;
args = (zval *)safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval), 0);
@@ -1313,7 +1315,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
} else if (ZEND_NUM_ARGS() == 2 ) { /* Safe to add conntype_option, since 2 args was illegal */
connstring = Z_STRVAL(args[0]);
convert_to_long_ex(&args[1]);
- connect_type = Z_LVAL(args[1]);
+ connect_type = (int)Z_LVAL(args[1]);
} else {
host = Z_STRVAL(args[0]);
port = Z_STRVAL(args[1]);
@@ -1566,7 +1568,7 @@ PHP_FUNCTION(pg_close)
}
if (argc == 0) {
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
@@ -1613,7 +1615,7 @@ static void php_pgsql_get_link_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type
}
if (argc == 0) {
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
@@ -1760,7 +1762,7 @@ PHP_FUNCTION(pg_parameter_status)
id = -1;
} else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &param, &len) == SUCCESS) {
pgsql_link = NULL;
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
} else {
RETURN_FALSE;
}
@@ -1793,7 +1795,7 @@ PHP_FUNCTION(pg_ping)
id = -1;
} else {
pgsql_link = NULL;
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
}
if (pgsql_link == NULL && id == -1) {
RETURN_FALSE;
@@ -1836,7 +1838,7 @@ PHP_FUNCTION(pg_query)
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
return;
}
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &pgsql_link, &query, &query_len) == FAILURE) {
@@ -1939,7 +1941,7 @@ PHP_FUNCTION(pg_query_params)
if (zend_parse_parameters(argc TSRMLS_CC, "sa", &query, &query_len, &pv_param_arr) == FAILURE) {
return;
}
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
if (zend_parse_parameters(argc TSRMLS_CC, "rsa", &pgsql_link, &query, &query_len, &pv_param_arr) == FAILURE) {
@@ -2055,7 +2057,7 @@ PHP_FUNCTION(pg_prepare)
if (zend_parse_parameters(argc TSRMLS_CC, "ss", &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
return;
}
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
if (zend_parse_parameters(argc TSRMLS_CC, "rss", &pgsql_link, &stmtname, &stmtname_len, &query, &query_len) == FAILURE) {
@@ -2142,7 +2144,7 @@ PHP_FUNCTION(pg_execute)
if (zend_parse_parameters(argc TSRMLS_CC, "sa/", &stmtname, &stmtname_len, &pv_param_arr)==FAILURE) {
return;
}
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
if (zend_parse_parameters(argc TSRMLS_CC, "rsa/", &pgsql_link, &stmtname, &stmtname_len, &pv_param_arr) == FAILURE) {
@@ -2420,7 +2422,7 @@ PHP_FUNCTION(pg_field_table)
RETURN_FALSE;
}
- oid = PQftable(pg_result->result, fnum);
+ oid = PQftable(pg_result->result, (int)fnum);
if (InvalidOid == oid) {
RETURN_FALSE;
@@ -2515,20 +2517,20 @@ static void php_pgsql_get_field_info(INTERNAL_FUNCTION_PARAMETERS, int entry_typ
switch (entry_type) {
case PHP_PG_FIELD_NAME:
- RETURN_STRING(PQfname(pgsql_result, field));
+ RETURN_STRING(PQfname(pgsql_result, (int)field));
break;
case PHP_PG_FIELD_SIZE:
- RETURN_LONG(PQfsize(pgsql_result, field));
+ RETURN_LONG(PQfsize(pgsql_result, (int)field));
break;
case PHP_PG_FIELD_TYPE: {
- char *name = get_field_name(pg_result->conn, PQftype(pgsql_result, field), &EG(regular_list) TSRMLS_CC);
+ char *name = get_field_name(pg_result->conn, PQftype(pgsql_result, (int)field), &EG(regular_list) TSRMLS_CC);
RETVAL_STRING(name);
efree(name);
}
break;
case PHP_PG_FIELD_TYPE_OID:
- oid = PQftype(pgsql_result, field);
+ oid = PQftype(pgsql_result, (int)field);
#if UINT_MAX > ZEND_LONG_MAX
if (oid > ZEND_LONG_MAX) {
smart_str s = {0};
@@ -2633,26 +2635,30 @@ PHP_FUNCTION(pg_fetch_result)
RETURN_FALSE;
}
} else {
- pgsql_row = row;
- if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) {
+ if (row < 0 || row >= PQntuples(pgsql_result)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
row, Z_LVAL_P(result));
RETURN_FALSE;
}
+ pgsql_row = (int)row;
}
switch (Z_TYPE_P(field)) {
case IS_STRING:
field_offset = PQfnumber(pgsql_result, Z_STRVAL_P(field));
+ if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ RETURN_FALSE;
+ }
break;
default:
convert_to_long_ex(field);
- field_offset = Z_LVAL_P(field);
+ if (Z_LVAL_P(field) < 0 || Z_LVAL_P(field) >= PQnfields(pgsql_result)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ RETURN_FALSE;
+ }
+ field_offset = (int)Z_LVAL_P(field);
break;
}
- if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
- RETURN_FALSE;
- }
if (PQgetisnull(pgsql_result, pgsql_row, field_offset)) {
RETVAL_NULL();
@@ -2718,13 +2724,13 @@ static void php_pgsql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
pgsql_result = pg_result->result;
if (use_row) {
- pgsql_row = row;
- pg_result->row = pgsql_row;
- if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) {
+ if (row < 0 || row >= PQntuples(pgsql_result)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
row, Z_LVAL_P(result));
RETURN_FALSE;
}
+ pgsql_row = (int)row;
+ pg_result->row = pgsql_row;
} else {
/* If 2nd param is NULL, use internal row counter to access next row */
pgsql_row = pg_result->row;
@@ -2904,7 +2910,7 @@ PHP_FUNCTION(pg_fetch_all_columns)
pgsql_result = pg_result->result;
num_fields = PQnfields(pgsql_result);
- if (colno >= num_fields || colno < 0) {
+ if (colno >= (zend_long)num_fields || colno < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column number '%pd'", colno);
RETURN_FALSE;
}
@@ -2916,10 +2922,10 @@ PHP_FUNCTION(pg_fetch_all_columns)
}
for (pg_row = 0; pg_row < pg_numrows; pg_row++) {
- if (PQgetisnull(pgsql_result, pg_row, colno)) {
+ if (PQgetisnull(pgsql_result, pg_row, (int)colno)) {
add_next_index_null(return_value);
} else {
- add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, colno));
+ add_next_index_string(return_value, PQgetvalue(pgsql_result, pg_row, (int)colno));
}
}
}
@@ -2944,7 +2950,7 @@ PHP_FUNCTION(pg_result_seek)
}
/* seek to offset */
- pg_result->row = row;
+ pg_result->row = (int)row;
RETURN_TRUE;
}
/* }}} */
@@ -2984,28 +2990,32 @@ static void php_pgsql_data_info(INTERNAL_FUNCTION_PARAMETERS, int entry_type)
RETURN_FALSE;
}
} else {
- pgsql_row = row;
- if (pgsql_row < 0 || pgsql_row >= PQntuples(pgsql_result)) {
+ if (row < 0 || row >= PQntuples(pgsql_result)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to jump to row %pd on PostgreSQL result index %pd",
row, Z_LVAL_P(result));
RETURN_FALSE;
}
+ pgsql_row = (int)row;
}
switch (Z_TYPE_P(field)) {
case IS_STRING:
convert_to_string_ex(field);
field_offset = PQfnumber(pgsql_result, Z_STRVAL_P(field));
+ if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ RETURN_FALSE;
+ }
break;
default:
convert_to_long_ex(field);
- field_offset = Z_LVAL_P(field);
+ if (Z_LVAL_P(field) < 0 || Z_LVAL_P(field) >= PQnfields(pgsql_result)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
+ RETURN_FALSE;
+ }
+ field_offset = (int)Z_LVAL_P(field);
break;
}
- if (field_offset < 0 || field_offset >= PQnfields(pgsql_result)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified");
- RETURN_FALSE;
- }
switch (entry_type) {
case PHP_PG_DATA_LENGTH:
@@ -3098,7 +3108,7 @@ PHP_FUNCTION(pg_trace)
PGconn *pgsql;
FILE *fp = NULL;
php_stream *stream;
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
if (zend_parse_parameters(argc TSRMLS_CC, "s|sr", &z_filename, &z_filename_len, &mode, &mode_len, &pgsql_link) == FAILURE) {
return;
@@ -3143,7 +3153,7 @@ PHP_FUNCTION(pg_untrace)
}
if (argc == 0) {
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
@@ -3176,7 +3186,7 @@ PHP_FUNCTION(pg_lo_create)
}
if (pgsql_link == NULL) {
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
if (id == -1) {
RETURN_FALSE;
@@ -3269,7 +3279,7 @@ PHP_FUNCTION(pg_lo_unlink)
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
@@ -3279,7 +3289,7 @@ PHP_FUNCTION(pg_lo_unlink)
RETURN_FALSE;
}
oid = (Oid)oid_long;
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
else {
@@ -3341,7 +3351,7 @@ PHP_FUNCTION(pg_lo_open)
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
@@ -3351,7 +3361,7 @@ PHP_FUNCTION(pg_lo_open)
RETURN_FALSE;
}
oid = (Oid)oid_long;
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
else {
@@ -3453,7 +3463,8 @@ PHP_FUNCTION(pg_lo_read)
{
zval *pgsql_id;
zend_long len;
- int buf_len = PGSQL_LO_READ_BUF_SIZE, nbytes, argc = ZEND_NUM_ARGS();
+ size_t buf_len = PGSQL_LO_READ_BUF_SIZE;
+ int nbytes, argc = ZEND_NUM_ARGS();
zend_string *buf;
pgLofp *pgsql;
@@ -3464,7 +3475,7 @@ PHP_FUNCTION(pg_lo_read)
ZEND_FETCH_RESOURCE(pgsql, pgLofp *, pgsql_id, -1, "PostgreSQL large object", le_lofp);
if (argc > 1) {
- buf_len = len;
+ buf_len = len < 0 ? 0 : len;
}
buf = zend_string_alloc(buf_len, 0);
@@ -3496,7 +3507,7 @@ PHP_FUNCTION(pg_lo_write)
}
if (argc > 2) {
- if (z_len > str_len) {
+ if (z_len > (zend_long)str_len) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot write more than buffer size %d. Tried to write %pd", str_len, z_len);
RETURN_FALSE;
}
@@ -3563,7 +3574,7 @@ PHP_FUNCTION(pg_lo_import)
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
"p|z", &file_in, &name_len, &oid) == SUCCESS) {
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
/* old calling convention, deprecated since PHP 4.2 */
@@ -3672,7 +3683,7 @@ PHP_FUNCTION(pg_lo_export)
RETURN_FALSE;
}
oid = (Oid)oid_long;
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
@@ -3683,7 +3694,7 @@ PHP_FUNCTION(pg_lo_export)
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong OID value passed");
RETURN_FALSE;
}
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
else if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc TSRMLS_CC,
@@ -3747,9 +3758,9 @@ PHP_FUNCTION(pg_lo_seek)
#if HAVE_PG_LO64
if (PQserverVersion((PGconn *)pgsql->conn) >= 90300) {
- result = lo_lseek64((PGconn *)pgsql->conn, pgsql->lofd, offset, whence);
+ result = lo_lseek64((PGconn *)pgsql->conn, pgsql->lofd, offset, (int)whence);
} else {
- result = lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, offset, whence);
+ result = lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, (int)offset, (int)whence);
}
#else
result = lo_lseek((PGconn *)pgsql->conn, pgsql->lofd, offset, whence);
@@ -3839,7 +3850,7 @@ PHP_FUNCTION(pg_set_error_verbosity)
if (zend_parse_parameters(argc TSRMLS_CC, "l", &verbosity) == FAILURE) {
return;
}
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
if (zend_parse_parameters(argc TSRMLS_CC, "rl", &pgsql_link, &verbosity) == FAILURE) {
@@ -3877,7 +3888,7 @@ PHP_FUNCTION(pg_set_client_encoding)
if (zend_parse_parameters(argc TSRMLS_CC, "s", &encoding, &encoding_len) == FAILURE) {
return;
}
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
if (zend_parse_parameters(argc TSRMLS_CC, "rs", &pgsql_link, &encoding, &encoding_len) == FAILURE) {
@@ -3908,7 +3919,7 @@ PHP_FUNCTION(pg_client_encoding)
}
if (argc == 0) {
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
@@ -3943,7 +3954,7 @@ PHP_FUNCTION(pg_end_copy)
}
if (argc == 0) {
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
}
@@ -3978,7 +3989,7 @@ PHP_FUNCTION(pg_put_line)
if (zend_parse_parameters(argc TSRMLS_CC, "s", &query, &query_len) == FAILURE) {
return;
}
- id = PGG(default_link) ? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
CHECK_DEFAULT_LINK(id);
} else {
if (zend_parse_parameters(argc TSRMLS_CC, "rs", &pgsql_link, &query, &query_len) == FAILURE) {
@@ -4198,7 +4209,7 @@ PHP_FUNCTION(pg_copy_from)
if(Z_STRLEN_P(tmp) > 0 && *(query + Z_STRLEN_P(tmp) - 1) != '\n') {
strlcat(query, "\n", Z_STRLEN_P(tmp) + 2);
}
- if (PQputCopyData(pgsql, query, strlen(query)) != 1) {
+ if (PQputCopyData(pgsql, query, (int)strlen(query)) != 1) {
efree(query);
PHP_PQ_ERROR("copy failed: %s", pgsql);
RETURN_FALSE;
@@ -4276,7 +4287,7 @@ PHP_FUNCTION(pg_escape_string)
return;
}
pgsql_link = NULL;
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
break;
default:
@@ -4321,7 +4332,7 @@ PHP_FUNCTION(pg_escape_bytea)
return;
}
pgsql_link = NULL;
- id = PGG(default_link)? PGG(default_link)->handle : -1;
+ id = FETCH_DEFAULT_LINK();
break;
default:
@@ -4494,7 +4505,7 @@ static void php_pgsql_escape_internal(INTERNAL_FUNCTION_PARAMETERS, int escape_l
return;
}
pgsql_link = NULL;
- id = PGG(default_link)? PGG(default_link)->handle : - 1;
+ id = FETCH_DEFAULT_LINK();
break;
default:
@@ -4604,7 +4615,7 @@ PHP_FUNCTION(pg_result_error_field)
#endif
|PG_DIAG_CONTEXT|PG_DIAG_SOURCE_FILE|PG_DIAG_SOURCE_LINE
|PG_DIAG_SOURCE_FUNCTION)) {
- field = (char *)PQresultErrorField(pgsql_result, fieldcode);
+ field = (char *)PQresultErrorField(pgsql_result, (int)fieldcode);
if (field == NULL) {
RETURN_NULL();
} else {
diff --git a/ext/pgsql/tests/80_bug36625.phpt b/ext/pgsql/tests/80_bug36625.phpt
index e1b7fa1b50..87dd84adc4 100644
--- a/ext/pgsql/tests/80_bug36625.phpt
+++ b/ext/pgsql/tests/80_bug36625.phpt
@@ -42,7 +42,13 @@ var_dump(file_exists($tracefile));
?>
===DONE===
--CLEAN--
-<?php unlink($tracefile); ?>
+<?php
+
+$tracefile = dirname(__FILE__) . '/trace.tmp';
+
+unlink($tracefile);
+
+?>
--EXPECTF--
bool(false)
resource(%d) of type (pgsql result)
diff --git a/ext/pgsql/tests/config.inc b/ext/pgsql/tests/config.inc
index be652b2507..e9944de793 100644
--- a/ext/pgsql/tests/config.inc
+++ b/ext/pgsql/tests/config.inc
@@ -1,10 +1,12 @@
<?php
+
// These vars are used to connect db and create test table.
-// values can be set to meet your environment
+// values can be set to meet your environment with the
+// environment var PGSQL_TEST_CONNSTR
+
+// "test" database must exist. i.e. "createdb test" before testing
+$conn_str = getenv('PGSQL_TEST_CONNSTR') ?: "host=localhost dbname=test port=5432"; // connection string
-// "test" database must be existed. i.e. "createdb test" before testing
-// PostgreSQL uses login name as username, user must have access to "test" database.
-$conn_str = "user=test password=test host=localhost dbname=test port=5432"; // connection string
$table_name = "php_pgsql_test"; // test table that will be created
$table_name_92 = "php_pgsql_test_92"; // test table that will be created
$num_test_record = 1000; // Number of records to create
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index debcc2c34d..140e681dfb 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -116,7 +116,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
/* {{{ Smart string functions */
typedef struct _string {
zend_string *buf;
- int alloced;
+ size_t alloced;
} string;
static void string_init(string *str)
@@ -129,16 +129,16 @@ static void string_init(string *str)
static string *string_printf(string *str, const char *format, ...)
{
- int len;
+ size_t len;
va_list arg;
char *s_tmp;
va_start(arg, format);
len = zend_vspprintf(&s_tmp, 0, format, arg);
if (len) {
- register int nlen = (str->buf->len + 1 + len + (1024 - 1)) & ~(1024 - 1);
+ register size_t nlen = (str->buf->len + 1 + len + (1024 - 1)) & ~(1024 - 1);
if (str->alloced < nlen) {
- int old_len = str->buf->len;
+ size_t old_len = str->buf->len;
str->alloced = nlen;
str->buf = zend_string_realloc(str->buf, str->alloced, 0);
str->buf->len = old_len;
@@ -151,11 +151,11 @@ static string *string_printf(string *str, const char *format, ...)
return str;
}
-static string *string_write(string *str, char *buf, int len)
+static string *string_write(string *str, char *buf, size_t len)
{
- register int nlen = (str->buf->len + 1 + len + (1024 - 1)) & ~(1024 - 1);
+ register size_t nlen = (str->buf->len + 1 + len + (1024 - 1)) & ~(1024 - 1);
if (str->alloced < nlen) {
- int old_len = str->buf->len;
+ size_t old_len = str->buf->len;
str->alloced = nlen;
str->buf = zend_string_realloc(str->buf, str->alloced, 0);
str->buf->len = old_len;
@@ -603,7 +603,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
{
zend_string *key;
zend_ulong num_index;
- uint len = mptr->common.function_name->len;
+ size_t len = mptr->common.function_name->len;
/* Do not display old-style inherited constructors */
if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0
@@ -809,7 +809,7 @@ static void _function_string(string *str, zend_function *fptr, zend_class_entry
string param_indent;
zend_function *overwrites;
zend_string *lc_name;
- unsigned int lc_name_len;
+ size_t lc_name_len;
/* TBD: Repair indenting of doc comment (or is this to be done in the parser?)
* What's "wrong" is that any whitespace before the doc comment start is
@@ -1196,7 +1196,7 @@ static void reflection_extension_factory(zval *object, const char *name_str TSRM
{
reflection_object *intern;
zval name;
- int name_len = strlen(name_str);
+ size_t name_len = strlen(name_str);
zend_string *lcname;
struct _zend_module_entry *module;
@@ -2141,7 +2141,7 @@ ZEND_METHOD(reflection_parameter, __construct)
/* First, find the function */
switch (Z_TYPE_P(reference)) {
case IS_STRING: {
- unsigned int lcname_len;
+ size_t lcname_len;
char *lcname;
lcname_len = Z_STRLEN_P(reference);
@@ -2160,7 +2160,7 @@ ZEND_METHOD(reflection_parameter, __construct)
case IS_ARRAY: {
zval *classref;
zval *method;
- unsigned int lcname_len;
+ size_t lcname_len;
char *lcname;
if (((classref =zend_hash_index_find(Z_ARRVAL_P(reference), 0)) == NULL)
@@ -2224,7 +2224,7 @@ ZEND_METHOD(reflection_parameter, __construct)
/* Now, search for the parameter */
arg_info = fptr->common.arg_info;
if (Z_TYPE_P(parameter) == IS_LONG) {
- position= Z_LVAL_P(parameter);
+ position= (int)Z_LVAL_P(parameter);
if (position < 0 || (uint32_t)position >= fptr->common.num_args) {
if (fptr->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) {
if (fptr->type != ZEND_OVERLOADED_FUNCTION) {
@@ -3359,12 +3359,10 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value
continue;
}
prop = NULL;
- if (prop_info->offset >= 0) {
- if (statics && (prop_info->flags & ZEND_ACC_STATIC) != 0) {
- prop = &ce->default_static_members_table[prop_info->offset];
- } else if (!statics && (prop_info->flags & ZEND_ACC_STATIC) == 0) {
- prop = &ce->default_properties_table[prop_info->offset];
- }
+ if (statics && (prop_info->flags & ZEND_ACC_STATIC) != 0) {
+ prop = &ce->default_static_members_table[prop_info->offset];
+ } else if (!statics && (prop_info->flags & ZEND_ACC_STATIC) == 0) {
+ prop = &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)];
}
if (!prop) {
continue;
@@ -3707,10 +3705,10 @@ ZEND_METHOD(reflection_class, getMethod)
/* }}} */
/* {{{ _addmethod */
-static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, long filter, zval *obj TSRMLS_DC)
+static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, zend_long filter, zval *obj TSRMLS_DC)
{
zval method;
- uint len = mptr->common.function_name->len;
+ size_t len = mptr->common.function_name->len;
zend_function *closure;
if (mptr->common.fn_flags & filter) {
if (ce == zend_ce_closure && obj && (len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
@@ -3819,7 +3817,7 @@ ZEND_METHOD(reflection_class, getProperty)
zend_property_info *property_info;
zend_string *name, *classname;
char *tmp, *str_name;
- int classname_len, str_name_len;
+ size_t classname_len, str_name_len;
METHOD_NOTSTATIC(reflection_class_ptr);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &name) == FAILURE) {
@@ -5407,7 +5405,7 @@ ZEND_METHOD(reflection_extension, getDependencies)
while(dep->name) {
zend_string *relation;
char *rel_type;
- int len = 0;
+ size_t len = 0;
switch(dep->type) {
case MODULE_DEP_REQUIRED:
diff --git a/ext/session/session.c b/ext/session/session.c
index d8f92d2d57..12564fa5b9 100644
--- a/ext/session/session.c
+++ b/ext/session/session.c
@@ -506,17 +506,8 @@ static void php_session_initialize(TSRMLS_D) /* {{{ */
PS(session_status) = php_session_active;
}
if (val) {
- PHP_MD5_CTX context;
-
- /* Store read data's MD5 hash */
- PHP_MD5Init(&context);
- PHP_MD5Update(&context, val->val, val->len);
- PHP_MD5Final(PS(session_data_hash), &context);
-
php_session_decode(val->val, val->len TSRMLS_CC);
zend_string_release(val);
- } else {
- memset(PS(session_data_hash),'\0', 16);
}
if (!PS(use_cookies) && PS(send_cookie)) {
@@ -538,19 +529,7 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */
val = php_session_encode(TSRMLS_C);
if (val) {
- PHP_MD5_CTX context;
- unsigned char digest[16];
-
- /* Generate data's MD5 hash */
- PHP_MD5Init(&context);
- PHP_MD5Update(&context, val->val, val->len);
- PHP_MD5Final(digest, &context);
- /* Write only when save is required */
- if (memcmp(digest, PS(session_data_hash), 16)) {
- ret = PS(mod)->s_write(&PS(mod_data), PS(id), val TSRMLS_CC);
- } else {
- ret = SUCCESS;
- }
+ ret = PS(mod)->s_write(&PS(mod_data), PS(id), val TSRMLS_CC);
zend_string_release(val);
} else {
ret = PS(mod)->s_write(&PS(mod_data), PS(id), STR_EMPTY_ALLOC() TSRMLS_CC);
@@ -1971,7 +1950,6 @@ static PHP_FUNCTION(session_regenerate_id)
RETURN_FALSE;
}
zend_string_release(PS(id));
- memset(PS(session_data_hash),'\0', 16);
}
PS(id) = PS(mod)->s_create_sid(&PS(mod_data) TSRMLS_CC);
diff --git a/ext/session/tests/session_set_save_handler_iface_003.phpt b/ext/session/tests/session_set_save_handler_iface_003.phpt
index bd757dce63..4d7ed3b7ee 100644
--- a/ext/session/tests/session_set_save_handler_iface_003.phpt
+++ b/ext/session/tests/session_set_save_handler_iface_003.phpt
@@ -38,7 +38,8 @@ class MySession2 implements SessionHandlerInterface, SessionIdInterface {
}
public function write($id, $data) {
- return file_put_contents($this->path . $id, $data);
+ // Empty $data = 0 = false
+ return (bool)file_put_contents($this->path . $id, $data);
}
public function destroy($id) {
diff --git a/ext/session/tests/session_set_save_handler_sid_001.phpt b/ext/session/tests/session_set_save_handler_sid_001.phpt
index 0dc4fc11cf..24ba5d7489 100644
--- a/ext/session/tests/session_set_save_handler_sid_001.phpt
+++ b/ext/session/tests/session_set_save_handler_sid_001.phpt
@@ -32,7 +32,8 @@ class MySession2 {
}
public function write($id, $data) {
- return file_put_contents($this->path . $id, $data);
+ // Empty $data = 0 = false
+ return (bool)file_put_contents($this->path . $id, $data);
}
public function destroy($id) {
diff --git a/ext/session/tests/session_set_save_handler_write_short_circuit.phpt b/ext/session/tests/session_set_save_handler_write_short_circuit.phpt
index 02ca182ec6..08da29a8fd 100644
--- a/ext/session/tests/session_set_save_handler_write_short_circuit.phpt
+++ b/ext/session/tests/session_set_save_handler_write_short_circuit.phpt
@@ -5,6 +5,7 @@ session.save_path=
session.name=PHPSESSID
--SKIPIF--
<?php include('skipif.inc'); ?>
+skip - Waiting RFC patch merge
--FILE--
<?php
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 18397dace3..f3f336117f 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -4717,6 +4717,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level)
if (type->attributes &&
(attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType",
sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType")-1)) != NULL &&
+ attr->extraAttributes &&
(ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType")-1)) != NULL) {
char *end = strchr(ext->val, '[');
int len;
@@ -4740,6 +4741,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level)
if (type->attributes &&
(attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType",
sizeof(SOAP_1_2_ENC_NAMESPACE":itemType")-1)) != NULL &&
+ attr->extraAttributes &&
(ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arrayType")-1)) != NULL) {
smart_str_appends(buf, ext->val);
smart_str_appendc(buf, ' ');
@@ -4757,6 +4759,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level)
if (type->attributes &&
(attr = zend_hash_str_find_ptr(type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize",
sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize")-1)) != NULL &&
+ attr->extraAttributes &&
(ext = zend_hash_str_find_ptr(attr->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arraySize")-1)) != NULL) {
smart_str_appendc(buf, '[');
smart_str_appends(buf, ext->val);
diff --git a/ext/soap/tests/bug68361.phpt b/ext/soap/tests/bug68361.phpt
new file mode 100644
index 0000000000..6dbba8a425
--- /dev/null
+++ b/ext/soap/tests/bug68361.phpt
@@ -0,0 +1,114 @@
+--TEST--
+Bug #68361 Segmentation fault on SoapClient::__getTypes
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+
+$xml = <<<XML
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="TestServer" targetNamespace="http://foo.bar/testserver" xmlns:tns="http://foo.bar/testserver" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:ns="http://foo.bar/testserver/types">
+ <types>
+ <xsd:schema targetNamespace="http://foo.bar/testserver/types" xmlns="http://foo.bar/testserver/types">
+ <xsd:complexType name="ArrayOfEmployeeReturn">
+ <xsd:complexContent>
+ <xsd:restriction base="soapenc:Array">
+ <xsd:attribute ref="soapenc:arrayType" arrayType="ns:Employee[]"/>
+ </xsd:restriction>
+ </xsd:complexContent>
+ </xsd:complexType>
+ <xsd:complexType name="Employee">
+ <xsd:sequence>
+ <xsd:element name="id" type="xsd:int"/>
+ <xsd:element name="department" type="xsd:string"/>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="age" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="Employee" nillable="true" type="ns:Employee"/>
+ <xsd:complexType name="User">
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"/>
+ <xsd:element name="age" type="xsd:int"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="User" nillable="true" type="ns:User"/>
+ </xsd:schema>
+ </types>
+ <message name="getEmployeeRequest">
+ <part name="name" type="xsd:name"/>
+ </message>
+ <message name="getEmployeeResponse">
+ <part name="employeeReturn" type="ns:ArrayOfEmployeeReturn"/>
+ </message>
+ <message name="getUserRequest">
+ <part name="id" type="xsd:id"/>
+ </message>
+ <message name="getUserResponse">
+ <part name="userReturn" element="ns:User"/>
+ </message>
+ <portType name="TestServerPortType">
+ <operation name="getEmployee">
+ <input message="tns:getEmployeeRequest"/>
+ <output message="tns:getEmployeeResponse"/>
+ </operation>
+ <operation name="getUser">
+ <input message="tns:getUserRequest"/>
+ <output message="tns:getUserResponse"/>
+ </operation>
+ </portType>
+ <binding name="TestServerBinding" type="tns:TestServerPortType">
+ <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="getEmployee">
+ <soap:operation soapAction="http://foo.bar/testserver/#getEmployee"/>
+ <input>
+ <soap:body use="literal" namespace="http://foo.bar/testserver"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://foo.bar/testserver"/>
+ </output>
+ </operation>
+ <operation name="getUser">
+ <soap:operation soapAction="http://foo.bar/testserver/#getUser"/>
+ <input>
+ <soap:body use="literal" namespace="http://foo.bar/testserver"/>
+ </input>
+ <output>
+ <soap:body use="literal" namespace="http://foo.bar/testserver"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="TestServerService">
+ <port name="TestServerPort" binding="tns:TestServerBinding">
+ <soap:address location="http://localhost/wsdl-creator/TestClass.php"/>
+ </port>
+ </service>
+</definitions>
+XML;
+
+file_put_contents(__DIR__ . "/bug68361.xml", $xml);
+$client = new SoapClient(__DIR__ . "/bug68361.xml");
+
+$res = $client->__getTypes(); // Segmentation fault here
+
+print_r($res);
+?>
+--CLEAN--
+<?php
+unlink(__DIR__ . "/bug68361.xml");
+?>
+--EXPECT--
+Array
+(
+ [0] => anyType ArrayOfEmployeeReturn[]
+ [1] => struct Employee {
+ int id;
+ string department;
+ string name;
+ int age;
+}
+ [2] => struct User {
+ string name;
+ int age;
+}
+)
diff --git a/ext/sockets/tests/mcast_ipv4_send.phpt b/ext/sockets/tests/mcast_ipv4_send.phpt
index ac5bce9162..0dd858f297 100644
--- a/ext/sockets/tests/mcast_ipv4_send.phpt
+++ b/ext/sockets/tests/mcast_ipv4_send.phpt
@@ -1,65 +1,66 @@
---TEST--
-Multicast support: IPv4 send options
---SKIPIF--
-<?php
-if (!extension_loaded('sockets')) {
- die('skip sockets extension not available.');
-}
-if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) {
- die("skip interface 1 either doesn't exist or has no ipv4 address");
-}
---FILE--
-<?php
-$domain = AF_INET;
-$level = IPPROTO_IP;
-$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die("err");
-
-echo "Setting IP_MULTICAST_TTL\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 9);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_TTL);
-var_dump($r);
-echo "\n";
-
-echo "Setting IP_MULTICAST_LOOP\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 0);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
-var_dump($r);
-$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 1);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
-var_dump($r);
-echo "\n";
-
-echo "Setting IP_MULTICAST_IF\n";
-echo "interface 0:\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_IF, 0);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_IF);
-var_dump($r);
-echo "interface 1:\n";
-$r = socket_set_option($s, $level, IP_MULTICAST_IF, 1);
-var_dump($r);
-$r = socket_get_option($s, $level, IP_MULTICAST_IF);
-var_dump($r);
-echo "\n";
-
---EXPECT--
-Setting IP_MULTICAST_TTL
-bool(true)
-int(9)
-
-Setting IP_MULTICAST_LOOP
-bool(true)
-int(0)
-bool(true)
-int(1)
-
-Setting IP_MULTICAST_IF
-interface 0:
-bool(true)
-int(0)
-interface 1:
-bool(true)
-int(1)
+--TEST--
+Multicast support: IPv4 send options
+--SKIPIF--
+<?php
+if (!extension_loaded('sockets')) {
+ die('skip sockets extension not available.');
+}
+$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP) or die("err");
+if (socket_set_option($s, IPPROTO_IP, IP_MULTICAST_IF, 1) === false) {
+ die("skip interface 1 either doesn't exist or has no ipv4 address");
+}
+--FILE--
+<?php
+$domain = AF_INET;
+$level = IPPROTO_IP;
+$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die("err");
+
+echo "Setting IP_MULTICAST_TTL\n";
+$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 9);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_TTL);
+var_dump($r);
+echo "\n";
+
+echo "Setting IP_MULTICAST_LOOP\n";
+$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 0);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
+var_dump($r);
+$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 1);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
+var_dump($r);
+echo "\n";
+
+echo "Setting IP_MULTICAST_IF\n";
+echo "interface 0:\n";
+$r = socket_set_option($s, $level, IP_MULTICAST_IF, 0);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_IF);
+var_dump($r);
+echo "interface 1:\n";
+$r = socket_set_option($s, $level, IP_MULTICAST_IF, 1);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_IF);
+var_dump($r);
+echo "\n";
+
+--EXPECT--
+Setting IP_MULTICAST_TTL
+bool(true)
+int(9)
+
+Setting IP_MULTICAST_LOOP
+bool(true)
+int(0)
+bool(true)
+int(1)
+
+Setting IP_MULTICAST_IF
+interface 0:
+bool(true)
+int(0)
+interface 1:
+bool(true)
+int(1)
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c
index 1de8e021dd..aa740c40e2 100644
--- a/ext/spl/php_spl.c
+++ b/ext/spl/php_spl.c
@@ -255,7 +255,7 @@ static int spl_autoload(zend_string *class_name, zend_string *lc_name, const cha
zval result;
int ret;
- class_file_len = spprintf(&class_file, 0, "%s%.*s", lc_name->val, ext_len, ext);
+ class_file_len = (int)spprintf(&class_file, 0, "%s%.*s", lc_name->val, ext_len, ext);
#if DEFAULT_SLASH != '\\'
{
@@ -320,7 +320,7 @@ PHP_FUNCTION(spl_autoload)
pos_len = sizeof(SPL_DEFAULT_FILE_EXTENSIONS) - 1;
} else {
pos = file_exts->val;
- pos_len = file_exts->len;
+ pos_len = (int)file_exts->len;
}
lc_name = zend_string_alloc(class_name->len, 0);
@@ -328,7 +328,7 @@ PHP_FUNCTION(spl_autoload)
while (pos && *pos && !EG(exception)) {
pos1 = strchr(pos, ',');
if (pos1) {
- pos1_len = pos1 - pos;
+ pos1_len = (int)(pos1 - pos);
} else {
pos1_len = pos_len;
}
@@ -759,7 +759,7 @@ PHPAPI zend_string *php_spl_object_hash(zval *obj TSRMLS_DC) /* {{{*/
if (!SPL_G(hash_mask_init)) {
if (!BG(mt_rand_is_seeded)) {
- php_mt_srand(GENERATE_SEED() TSRMLS_CC);
+ php_mt_srand((uint32_t)GENERATE_SEED() TSRMLS_CC);
}
SPL_G(hash_mask_handle) = (intptr_t)(php_mt_rand(TSRMLS_C) >> 1);
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index 73588ff1bd..108eafddc4 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -199,7 +199,7 @@ static inline void spl_filesystem_object_get_file_name(spl_filesystem_object *in
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Object not initialized");
break;
case SPL_FS_DIR:
- intern->file_name_len = spprintf(&intern->file_name, 0, "%s%c%s",
+ intern->file_name_len = (int)spprintf(&intern->file_name, 0, "%s%c%s",
spl_filesystem_object_get_path(intern, NULL TSRMLS_CC),
slash, intern->u.dir.entry.d_name);
break;
@@ -233,7 +233,7 @@ static void spl_filesystem_dir_open(spl_filesystem_object* intern, char *path TS
int skip_dots = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_SKIPDOTS);
intern->type = SPL_FS_DIR;
- intern->_path_len = strlen(path);
+ intern->_path_len = (int)strlen(path);
intern->u.dir.dirp = php_stream_opendir(path, REPORT_ERRORS, FG(default_context));
if (intern->_path_len > 1 && IS_SLASH_AT(path, intern->_path_len-1)) {
@@ -384,7 +384,7 @@ void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path,
}
intern->file_name = use_copy ? estrndup(path, len) : path;
- intern->file_name_len = len;
+ intern->file_name_len = (int)len;
while (intern->file_name_len > 1 && IS_SLASH_AT(intern->file_name, intern->file_name_len-1)) {
intern->file_name[intern->file_name_len-1] = 0;
@@ -398,7 +398,7 @@ void spl_filesystem_info_set_filename(spl_filesystem_object *intern, char *path,
p2 = 0;
#endif
if (p1 || p2) {
- intern->_path_len = (p1 > p2 ? p1 : p2) - intern->file_name;
+ intern->_path_len = (int)((p1 > p2 ? p1 : p2) - intern->file_name);
} else {
intern->_path_len = 0;
}
@@ -934,7 +934,8 @@ SPL_METHOD(SplFileInfo, getExtension)
p = zend_memrchr(ret->val, '.', ret->len);
if (p) {
- idx = p - ret->val;
+ assert(p > ret->val);
+ idx = (int)(p - ret->val);
RETVAL_STRINGL(ret->val + idx + 1, ret->len - idx - 1);
zend_string_release(ret);
return;
@@ -962,7 +963,8 @@ SPL_METHOD(DirectoryIterator, getExtension)
p = zend_memrchr(fname->val, '.', fname->len);
if (p) {
- idx = p - fname->val;
+ assert(p > fname->val);
+ idx = (int)(p - fname->val);
RETVAL_STRINGL(fname->val + idx + 1, fname->len - idx - 1);
zend_string_release(fname);
} else {
@@ -1389,7 +1391,7 @@ SPL_METHOD(SplFileInfo, getPathInfo)
if (path) {
char *dpath = estrndup(path, path_len);
path_len = php_dirname(dpath, path_len);
- spl_filesystem_object_create_info(intern, dpath, path_len, 1, ce, return_value TSRMLS_CC);
+ spl_filesystem_object_create_info(intern, dpath, (int)path_len, 1, ce, return_value TSRMLS_CC);
efree(dpath);
}
}
@@ -1516,9 +1518,9 @@ SPL_METHOD(RecursiveDirectoryIterator, getChildren)
subdir = Z_SPLFILESYSTEM_P(return_value);
if (subdir) {
if (intern->u.dir.sub_path && intern->u.dir.sub_path[0]) {
- subdir->u.dir.sub_path_len = spprintf(&subdir->u.dir.sub_path, 0, "%s%c%s", intern->u.dir.sub_path, slash, intern->u.dir.entry.d_name);
+ subdir->u.dir.sub_path_len = (int)spprintf(&subdir->u.dir.sub_path, 0, "%s%c%s", intern->u.dir.sub_path, slash, intern->u.dir.entry.d_name);
} else {
- subdir->u.dir.sub_path_len = strlen(intern->u.dir.entry.d_name);
+ subdir->u.dir.sub_path_len = (int)strlen(intern->u.dir.entry.d_name);
subdir->u.dir.sub_path = estrndup(intern->u.dir.entry.d_name, subdir->u.dir.sub_path_len);
}
subdir->info_class = intern->info_class;
@@ -1553,7 +1555,7 @@ SPL_METHOD(RecursiveDirectoryIterator, getSubPathname)
{
spl_filesystem_object *intern = Z_SPLFILESYSTEM_P(getThis());
char *sub_name;
- int len;
+ size_t len;
char slash = SPL_HAS_FLAG(intern->flags, SPL_FILE_DIR_UNIXPATHS) ? '/' : DEFAULT_SLASH;
if (zend_parse_parameters_none() == FAILURE) {
@@ -2303,7 +2305,7 @@ SPL_METHOD(SplFileObject, __construct)
p2 = 0;
#endif
if (p1 || p2) {
- intern->_path_len = (p1 > p2 ? p1 : p2) - tmp_path;
+ intern->_path_len = (int)((p1 > p2 ? p1 : p2) - tmp_path);
} else {
intern->_path_len = 0;
}
@@ -2627,7 +2629,7 @@ SPL_METHOD(SplFileObject, fputcsv)
char delimiter = intern->u.file.delimiter, enclosure = intern->u.file.enclosure, escape = intern->u.file.escape;
char *delim = NULL, *enclo = NULL;
size_t d_len = 0, e_len = 0;
- int ret;
+ zend_long ret;
zval *fields = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a|ss", &fields, &delim, &d_len, &enclo, &e_len) == SUCCESS) {
@@ -2776,7 +2778,7 @@ SPL_METHOD(SplFileObject, fseek)
}
spl_filesystem_file_free_line(intern TSRMLS_CC);
- RETURN_LONG(php_stream_seek(intern->u.file.stream, pos, whence));
+ RETURN_LONG(php_stream_seek(intern->u.file.stream, pos, (int)whence));
} /* }}} */
/* {{{ proto int SplFileObject::fgetc()
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index 945f7c7ab4..8a61407589 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -1182,7 +1182,7 @@ SPL_METHOD(SplDoublyLinkedList, unserialize)
goto error;
}
- intern->flags = Z_LVAL(flags);
+ intern->flags = (int)Z_LVAL(flags);
zval_ptr_dtor(&flags);
/* elements */
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index ee5ef6b990..d63ac2e6e6 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -151,7 +151,7 @@ static HashTable* spl_fixedarray_object_get_gc(zval *obj, zval **table, int *n T
if (intern->array) {
*table = intern->array->elements;
- *n = intern->array->size;
+ *n = (int)intern->array->size;
} else {
*table = NULL;
*n = 0;
@@ -165,10 +165,10 @@ static HashTable* spl_fixedarray_object_get_properties(zval *obj TSRMLS_DC) /* {
{
spl_fixedarray_object *intern = Z_SPLFIXEDARRAY_P(obj);
HashTable *ht = zend_std_get_properties(obj TSRMLS_CC);
- int i = 0;
+ zend_long i = 0;
if (intern->array) {
- int j = zend_hash_num_elements(ht);
+ zend_long j = zend_hash_num_elements(ht);
for (i = 0; i < intern->array->size; i++) {
if (!Z_ISUNDEF(intern->array->elements[i])) {
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index d29150c1d6..b421c03757 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -160,12 +160,12 @@ static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) {
/* exception or call failure */
return 0;
}
- return lval;
+ return lval > 0 ? 1 : (lval < 0 ? -1 : 0);
}
}
compare_function(&result, a, b TSRMLS_CC);
- return Z_LVAL(result);
+ return (int)Z_LVAL(result);
}
/* }}} */
@@ -184,12 +184,12 @@ static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) {
/* exception or call failure */
return 0;
}
- return lval;
+ return lval > 0 ? 1 : (lval < 0 ? -1 : 0);
}
}
compare_function(&result, b, a TSRMLS_CC);
- return Z_LVAL(result);
+ return (int)Z_LVAL(result);
}
/* }}} */
@@ -215,12 +215,12 @@ static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /
/* exception or call failure */
return 0;
}
- return lval;
+ return lval > 0 ? 1 : (lval < 0 ? -1 : 0);
}
}
compare_function(&result, a_priority_p, b_priority_p TSRMLS_CC);
- return Z_LVAL(result);
+ return (int)Z_LVAL(result);
}
/* }}} */
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 8b09e3ef37..c129115eeb 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -540,7 +540,7 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
intern->iterators = emalloc(sizeof(spl_sub_iterator));
intern->level = 0;
intern->mode = mode;
- intern->flags = flags;
+ intern->flags = (int)flags;
intern->max_depth = -1;
intern->in_iteration = 0;
intern->ce = Z_OBJCE_P(object);
@@ -854,8 +854,11 @@ SPL_METHOD(RecursiveIteratorIterator, setMaxDepth)
if (max_depth < -1) {
zend_throw_exception(spl_ce_OutOfRangeException, "Parameter max_depth must be >= -1", 0 TSRMLS_CC);
return;
+ } else if (max_depth > INT_MAX) {
+ max_depth = INT_MAX;
}
- object->max_depth = max_depth;
+
+ object->max_depth = (int)max_depth;
} /* }}} */
/* {{{ proto int|false RecursiveIteratorIterator::getMaxDepth()
@@ -1423,9 +1426,9 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
static inline int spl_dual_it_fetch(spl_dual_it_object *intern, int check_more TSRMLS_DC);
-static inline int spl_cit_check_flags(int flags)
+static inline int spl_cit_check_flags(zend_long flags)
{
- int cnt = 0;
+ zend_long cnt = 0;
cnt += (flags & CIT_CALL_TOSTRING) ? 1 : 0;
cnt += (flags & CIT_TOSTRING_USE_KEY) ? 1 : 0;
@@ -2051,10 +2054,10 @@ SPL_METHOD(RegexIterator, accept)
use_copy = zend_make_printable_zval(subject_ptr, &subject_copy TSRMLS_CC);
if (use_copy) {
subject = Z_STRVAL(subject_copy);
- subject_len = Z_STRLEN(subject_copy);
+ subject_len = (int)Z_STRLEN(subject_copy);
} else {
subject = Z_STRVAL_P(subject_ptr);
- subject_len = Z_STRLEN_P(subject_ptr);
+ subject_len = (int)Z_STRLEN_P(subject_ptr);
}
use_copy = 0;
diff --git a/ext/spl/spl_iterators.h b/ext/spl/spl_iterators.h
index f0740275dc..76f0b45e57 100644
--- a/ext/spl/spl_iterators.h
+++ b/ext/spl/spl_iterators.h
@@ -134,7 +134,7 @@ typedef struct _spl_dual_it_object {
struct {
zval data;
zval key;
- int pos;
+ zend_long pos;
} current;
dual_it_type dit_type;
union {
diff --git a/ext/spl/spl_observer.c b/ext/spl/spl_observer.c
index d3ce72aaa3..f7f884df18 100644
--- a/ext/spl/spl_observer.c
+++ b/ext/spl/spl_observer.c
@@ -398,7 +398,7 @@ static int spl_object_storage_compare_info(zval *e1, zval *e2 TSRMLS_DC) /* {{{
return 1;
}
- return Z_LVAL(result);
+ return Z_LVAL(result) > 0 ? 1 : (Z_LVAL(result) < 0 ? -1 : 0);
}
/* }}} */
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 106bc54141..a168069cfb 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -4962,7 +4962,7 @@ static int user_tick_function_compare(user_tick_function_entry * tick_fe1, user_
}
/* }}} */
-void php_call_shutdown_functions(TSRMLS_D) /* {{{ */
+PHPAPI void php_call_shutdown_functions(TSRMLS_D) /* {{{ */
{
if (BG(user_shutdown_function_names)) {
zend_try {
@@ -4974,7 +4974,7 @@ void php_call_shutdown_functions(TSRMLS_D) /* {{{ */
}
/* }}} */
-void php_free_shutdown_functions(TSRMLS_D) /* {{{ */
+PHPAPI void php_free_shutdown_functions(TSRMLS_D) /* {{{ */
{
if (BG(user_shutdown_function_names))
zend_try {
diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h
index 815227118e..c47ee0fb96 100644
--- a/ext/standard/basic_functions.h
+++ b/ext/standard/basic_functions.h
@@ -34,6 +34,10 @@
#include "url_scanner_ex.h"
+#if defined(_WIN32) && defined(__clang__)
+#include <intrin.h>
+#endif
+
extern zend_module_entry basic_functions_module;
#define basic_functions_module_ptr &basic_functions_module
@@ -259,4 +263,8 @@ PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, siz
PHPAPI extern zend_bool remove_user_shutdown_function(char *function_name, size_t function_len TSRMLS_DC);
PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry TSRMLS_DC);
+PHPAPI void php_call_shutdown_functions(TSRMLS_D);
+PHPAPI void php_free_shutdown_functions(TSRMLS_D);
+
+
#endif /* BASIC_FUNCTIONS_H */
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 6106fe2c86..15e4876af5 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -242,9 +242,11 @@ PHP_FUNCTION(passthru)
PHPAPI zend_string *php_escape_shell_cmd(char *str)
{
register int x, y, l = (int)strlen(str);
- char *p = NULL;
size_t estimate = (2 * l) + 1;
zend_string *cmd;
+#ifndef PHP_WIN32
+ char *p = NULL;
+#endif
TSRMLS_FETCH();
diff --git a/ext/standard/file.c b/ext/standard/file.c
index ff7c5433eb..4804e49338 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -339,16 +339,16 @@ static int flock_values[] = { LOCK_SH, LOCK_EX, LOCK_UN };
Portable file locking */
PHP_FUNCTION(flock)
{
- zval *arg1, *arg3 = NULL;
+ zval *res, *wouldblock = NULL;
int act;
php_stream *stream;
zend_long operation = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z/", &arg1, &operation, &arg3) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z/", &res, &operation, &wouldblock) == FAILURE) {
return;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
act = operation & 3;
if (act < 1 || act > 3) {
@@ -356,16 +356,16 @@ PHP_FUNCTION(flock)
RETURN_FALSE;
}
- if (arg3) {
- zval_dtor(arg3);
- ZVAL_LONG(arg3, 0);
+ if (wouldblock) {
+ zval_dtor(wouldblock);
+ ZVAL_LONG(wouldblock, 0);
}
/* flock_values contains all possible actions if (operation & 4) we won't block on the lock */
act = flock_values[act - 1] | (operation & PHP_LOCK_NB ? LOCK_NB : 0);
if (php_stream_lock(stream, act)) {
- if (operation && errno == EWOULDBLOCK && arg3) {
- ZVAL_LONG(arg3, 1);
+ if (operation && errno == EWOULDBLOCK && wouldblock) {
+ ZVAL_LONG(wouldblock, 1);
}
RETURN_FALSE;
}
@@ -887,20 +887,20 @@ PHP_NAMED_FUNCTION(php_if_fopen)
Close an open file pointer */
PHPAPI PHP_FUNCTION(fclose)
{
- zval *arg1;
+ zval *res;
php_stream *stream;
#ifndef FAST_ZPP
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
#else
ZEND_PARSE_PARAMETERS_START(1, 1)
- Z_PARAM_RESOURCE(arg1)
+ Z_PARAM_RESOURCE(res)
ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE);
#endif
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
if ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%pd is not a valid stream resource", stream->res->handle);
@@ -965,14 +965,14 @@ PHP_FUNCTION(popen)
Close a file pointer opened by popen() */
PHP_FUNCTION(pclose)
{
- zval *arg1;
+ zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
FG(pclose_wait) = 1;
zend_list_close(stream->res);
@@ -985,14 +985,14 @@ PHP_FUNCTION(pclose)
Test for end-of-file on a file pointer */
PHPAPI PHP_FUNCTION(feof)
{
- zval *arg1;
+ zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
if (php_stream_eof(stream)) {
RETURN_TRUE;
@@ -1006,18 +1006,18 @@ PHPAPI PHP_FUNCTION(feof)
Get a line from file pointer */
PHPAPI PHP_FUNCTION(fgets)
{
- zval *arg1;
+ zval *res;
zend_long len = 1024;
char *buf = NULL;
int argc = ZEND_NUM_ARGS();
size_t line_len = 0;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &arg1, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &len) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
if (argc == 1) {
/* ask streams to give us a buffer of an appropriate size */
@@ -1062,16 +1062,16 @@ exit_failed:
Get a character from file pointer */
PHPAPI PHP_FUNCTION(fgetc)
{
- zval *arg1;
+ zval *res;
char buf[2];
int result;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
result = php_stream_getc(stream);
@@ -1193,39 +1193,33 @@ PHP_FUNCTION(fscanf)
Binary-safe file write */
PHPAPI PHP_FUNCTION(fwrite)
{
- zval *arg1;
- char *arg2;
- size_t arg2len;
+ zval *res;
+ char *input;
+ size_t inputlen;
size_t ret;
size_t num_bytes;
- zend_long arg3 = 0;
- char *buffer = NULL;
+ zend_long maxlen = 0;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &arg1, &arg2, &arg2len, &arg3) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|l", &res, &input, &inputlen, &maxlen) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 2) {
- num_bytes = arg2len;
+ num_bytes = inputlen;
+ } else if (maxlen <= 0) {
+ num_bytes = 0;
} else {
- if (arg3 > 0) {
- num_bytes = MIN((size_t)arg3, arg2len);
- } else {
- num_bytes = 0;
- }
+ num_bytes = MIN((size_t) maxlen, inputlen);
}
if (!num_bytes) {
RETURN_LONG(0);
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
- ret = php_stream_write(stream, buffer ? buffer : arg2, num_bytes);
- if (buffer) {
- efree(buffer);
- }
+ ret = php_stream_write(stream, input, num_bytes);
RETURN_LONG(ret);
}
@@ -1235,15 +1229,15 @@ PHPAPI PHP_FUNCTION(fwrite)
Flushes output */
PHPAPI PHP_FUNCTION(fflush)
{
- zval *arg1;
+ zval *res;
int ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
ret = php_stream_flush(stream);
if (ret) {
@@ -1257,14 +1251,14 @@ PHPAPI PHP_FUNCTION(fflush)
Rewind the position of a file pointer */
PHPAPI PHP_FUNCTION(rewind)
{
- zval *arg1;
+ zval *res;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
if (-1 == php_stream_rewind(stream)) {
RETURN_FALSE;
@@ -1277,15 +1271,15 @@ PHPAPI PHP_FUNCTION(rewind)
Get file pointer's read/write position */
PHPAPI PHP_FUNCTION(ftell)
{
- zval *arg1;
+ zval *res;
zend_long ret;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
ret = php_stream_tell(stream);
if (ret == -1) {
@@ -1299,17 +1293,17 @@ PHPAPI PHP_FUNCTION(ftell)
Seek on a file pointer */
PHPAPI PHP_FUNCTION(fseek)
{
- zval *arg1;
- zend_long arg2, whence = SEEK_SET;
+ zval *res;
+ zend_long offset, whence = SEEK_SET;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &arg1, &arg2, &whence) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|l", &res, &offset, &whence) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
- RETURN_LONG(php_stream_seek(stream, arg2, (int)whence));
+ RETURN_LONG(php_stream_seek(stream, offset, (int) whence));
}
/* }}} */
@@ -1411,7 +1405,7 @@ PHP_FUNCTION(readfile)
Return or change the umask */
PHP_FUNCTION(umask)
{
- zend_long arg1 = 0;
+ zend_long mask = 0;
int oldumask;
oldumask = umask(077);
@@ -1420,14 +1414,14 @@ PHP_FUNCTION(umask)
BG(umask) = oldumask;
}
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &mask) == FAILURE) {
RETURN_FALSE;
}
if (ZEND_NUM_ARGS() == 0) {
umask(oldumask);
} else {
- umask((int)arg1);
+ umask((int) mask);
}
RETURN_LONG(oldumask);
@@ -1438,15 +1432,15 @@ PHP_FUNCTION(umask)
Output all remaining data from a file pointer */
PHPAPI PHP_FUNCTION(fpassthru)
{
- zval *arg1;
+ zval *res;
size_t size;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg1) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &res) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
size = php_stream_passthru(stream);
RETURN_LONG(size);
@@ -1780,15 +1774,15 @@ safe_to_copy:
Binary-safe file read */
PHPAPI PHP_FUNCTION(fread)
{
- zval *arg1;
+ zval *res;
zend_long len;
php_stream *stream;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &arg1, &len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &res, &len) == FAILURE) {
RETURN_FALSE;
}
- PHP_STREAM_TO_ZVAL(stream, arg1);
+ PHP_STREAM_TO_ZVAL(stream, res);
if (len <= 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c
index ed93345bac..01522bc7a9 100644
--- a/ext/standard/ftp_fopen_wrapper.c
+++ b/ext/standard/ftp_fopen_wrapper.c
@@ -635,11 +635,10 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count
zend_string_release(basename);
/* Trim off trailing whitespace characters */
- tmp_len--;
while (tmp_len > 0 &&
- (ent->d_name[tmp_len] == '\n' || ent->d_name[tmp_len] == '\r' ||
- ent->d_name[tmp_len] == '\t' || ent->d_name[tmp_len] == ' ')) {
- ent->d_name[tmp_len--] = '\0';
+ (ent->d_name[tmp_len - 1] == '\n' || ent->d_name[tmp_len - 1] == '\r' ||
+ ent->d_name[tmp_len - 1] == '\t' || ent->d_name[tmp_len - 1] == ' ')) {
+ ent->d_name[--tmp_len] = '\0';
}
return sizeof(php_stream_dirent);
diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c
index 011407da29..bb1b9c5a6a 100644
--- a/ext/standard/incomplete_class.c
+++ b/ext/standard/incomplete_class.c
@@ -150,7 +150,7 @@ PHPAPI zend_string *php_lookup_class_name(zval *object)
/* {{{ php_store_class_name
*/
-PHPAPI void php_store_class_name(zval *object, const char *name, uint32_t len)
+PHPAPI void php_store_class_name(zval *object, const char *name, size_t len)
{
zval val;
TSRMLS_FETCH();
diff --git a/ext/standard/password.c b/ext/standard/password.c
index c58c28ab3c..4f211dd35f 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -345,12 +345,11 @@ PHP_FUNCTION(password_hash)
if (options && (option_buffer = zend_symtable_str_find(options, "salt", sizeof("salt")-1)) != NULL) {
char *buffer;
- size_t buffer_len_int = 0;
- size_t buffer_len;
+ size_t buffer_len = 0;
switch (Z_TYPE_P(option_buffer)) {
case IS_STRING:
buffer = estrndup(Z_STRVAL_P(option_buffer), Z_STRLEN_P(option_buffer));
- buffer_len_int = Z_STRLEN_P(option_buffer);
+ buffer_len = Z_STRLEN_P(option_buffer);
break;
case IS_LONG:
case IS_DOUBLE:
@@ -361,7 +360,7 @@ PHP_FUNCTION(password_hash)
convert_to_string(&cast_option_buffer);
if (Z_TYPE(cast_option_buffer) == IS_STRING) {
buffer = estrndup(Z_STRVAL(cast_option_buffer), Z_STRLEN(cast_option_buffer));
- buffer_len_int = Z_STRLEN(cast_option_buffer);
+ buffer_len = Z_STRLEN(cast_option_buffer);
zval_dtor(&cast_option_buffer);
break;
}
@@ -377,16 +376,19 @@ PHP_FUNCTION(password_hash)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Non-string salt parameter supplied");
RETURN_NULL();
}
- if (buffer_len_int < 0) {
+
+ /* XXX all the crypt related APIs work with int for string length.
+ That should be revised for size_t and then we maybe don't require
+ the > INT_MAX check. */
+ if (buffer_len > INT_MAX) {
efree(hash_format);
efree(buffer);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied salt is too long");
- }
- buffer_len = (size_t) buffer_len_int;
- if (buffer_len < required_salt_len) {
+ RETURN_NULL();
+ } else if (buffer_len < required_salt_len) {
efree(hash_format);
efree(buffer);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %lu expecting %lu", (unsigned long) buffer_len, (unsigned long) required_salt_len);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %zd expecting %zd", buffer_len, required_salt_len);
RETURN_NULL();
} else if (php_password_salt_is_alphabet(buffer, buffer_len) == FAILURE) {
salt = safe_emalloc(required_salt_len, 1, 1);
@@ -394,7 +396,7 @@ PHP_FUNCTION(password_hash)
efree(hash_format);
efree(buffer);
efree(salt);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %lu", (unsigned long) buffer_len);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Provided salt is too short: %zd", buffer_len);
RETURN_NULL();
}
salt_len = required_salt_len;
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 1989a2eabc..8026b08d45 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -418,7 +418,7 @@ static php_stream_wrapper_ops php_stdio_wops = {
NULL /* rmdir */
};
-php_stream_wrapper php_stream_php_wrapper = {
+PHPAPI php_stream_wrapper php_stream_php_wrapper = {
&php_stdio_wops,
NULL,
0, /* is_url */
diff --git a/ext/standard/php_fopen_wrappers.h b/ext/standard/php_fopen_wrappers.h
index 084efc291c..6d6a5bde27 100644
--- a/ext/standard/php_fopen_wrappers.h
+++ b/ext/standard/php_fopen_wrappers.h
@@ -27,7 +27,7 @@ php_stream *php_stream_url_wrap_http(php_stream_wrapper *wrapper, const char *pa
php_stream *php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *path, const char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC);
extern PHPAPI php_stream_wrapper php_stream_http_wrapper;
extern PHPAPI php_stream_wrapper php_stream_ftp_wrapper;
-extern php_stream_wrapper php_stream_php_wrapper;
-extern php_stream_wrapper php_plain_files_wrapper;
+extern PHPAPI php_stream_wrapper php_stream_php_wrapper;
+extern PHPAPI php_stream_wrapper php_plain_files_wrapper;
#endif
diff --git a/ext/standard/php_incomplete_class.h b/ext/standard/php_incomplete_class.h
index 177e960765..fa2747f3bf 100644
--- a/ext/standard/php_incomplete_class.h
+++ b/ext/standard/php_incomplete_class.h
@@ -54,7 +54,7 @@ extern "C" {
PHPAPI zend_class_entry *php_create_incomplete_class(TSRMLS_D);
PHPAPI zend_string *php_lookup_class_name(zval *object);
-PHPAPI void php_store_class_name(zval *object, const char *name, uint32_t len);
+PHPAPI void php_store_class_name(zval *object, const char *name, size_t len);
#ifdef __cplusplus
};
diff --git a/ext/standard/tests/file/bug52820.phpt b/ext/standard/tests/file/bug52820.phpt
index 3a9f9c31a4..a00ebf50b6 100644
--- a/ext/standard/tests/file/bug52820.phpt
+++ b/ext/standard/tests/file/bug52820.phpt
@@ -1,71 +1,63 @@
---TEST--
-Bug #52820 (writes to fopencookie FILE* not committed when seeking the stream)
---SKIPIF--
-<?php
-if (!function_exists('leak_variable'))
- die("skip only for debug builds");
-/* unfortunately no standard function does a cast to FILE*, so we need
- * curl to test this */
-if (!extension_loaded("curl")) exit("skip curl extension not loaded");
-$handle=curl_init('http://127.0.0.1:37349/');
-curl_setopt($handle, CURLOPT_VERBOSE, true);
-curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
-if (!curl_setopt($handle, CURLOPT_STDERR, fopen("php://memory", "w+")))
- die("skip fopencookie not supported on this platform");
---FILE--
-<?php
-function do_stuff($url) {
- $handle=curl_init('http://127.0.0.1:37349/');
- curl_setopt($handle, CURLOPT_VERBOSE, true);
- curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($handle, CURLOPT_STDERR, $o = fopen($url, "w+"));
- curl_exec($handle);
- echo "About to rewind!\n";
- rewind($o);
- echo stream_get_contents($o);
- return $o;
-}
-
-echo "temp stream (close after):\n";
-fclose(do_stuff("php://temp"));
-
-echo "\nmemory stream (close after):\n";
-fclose(do_stuff("php://memory"));
-
-echo "\ntemp stream (leak):\n";
-leak_variable(do_stuff("php://temp"), true);
-
-echo "\nmemory stream (leak):\n";
-leak_variable(do_stuff("php://memory"), true);
-
-echo "\nDone.\n";
---EXPECTF--
-temp stream (close after):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-memory stream (close after):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-temp stream (leak):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-memory stream (leak):
-About to rewind!
-* About to connect() to 127.0.0.1 port 37349%r.*%r
-* Trying 127.0.0.1...%A* Connection refused
-* couldn't connect to host%S
-* Closing connection #0
-
-Done.
+--TEST--
+Bug #52820 (writes to fopencookie FILE* not committed when seeking the stream)
+--SKIPIF--
+<?php
+if (!function_exists('leak_variable'))
+ die("skip only for debug builds");
+/* unfortunately no standard function does a cast to FILE*, so we need
+ * curl to test this */
+if (!extension_loaded("curl")) exit("skip curl extension not loaded");
+$handle=curl_init('http://127.0.0.1:37349/');
+curl_setopt($handle, CURLOPT_VERBOSE, true);
+curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
+if (!curl_setopt($handle, CURLOPT_STDERR, fopen("php://memory", "w+")))
+ die("skip fopencookie not supported on this platform");
+--FILE--
+<?php
+function do_stuff($url) {
+ $handle=curl_init('http://127.0.0.1:37349/');
+ curl_setopt($handle, CURLOPT_VERBOSE, true);
+ curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($handle, CURLOPT_STDERR, $o = fopen($url, "w+"));
+ curl_exec($handle);
+ echo "About to rewind!\n";
+ rewind($o);
+ echo stream_get_contents($o);
+ return $o;
+}
+
+echo "temp stream (close after):\n";
+fclose(do_stuff("php://temp"));
+
+echo "\nmemory stream (close after):\n";
+fclose(do_stuff("php://memory"));
+
+echo "\ntemp stream (leak):\n";
+leak_variable(do_stuff("php://temp"), true);
+
+echo "\nmemory stream (leak):\n";
+leak_variable(do_stuff("php://memory"), true);
+
+echo "\nDone.\n";
+--EXPECTF--
+temp stream (close after):
+About to rewind!
+* %ATrying 127.0.0.1...%AConnection refused%A
+* Closing connection%A%d
+
+memory stream (close after):
+About to rewind!
+* %ATrying 127.0.0.1...%AConnection refused%A
+* Closing connection%A%d
+
+temp stream (leak):
+About to rewind!
+* %ATrying 127.0.0.1...%AConnection refused%A
+* Closing connection%A%d
+
+memory stream (leak):
+About to rewind!
+* %ATrying 127.0.0.1...%AConnection refused%A
+* Closing connection%A%d
+
+Done.
diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c
index 3d7aa985b8..6b406e673f 100644
--- a/ext/standard/url_scanner_ex.c
+++ b/ext/standard/url_scanner_ex.c
@@ -79,7 +79,7 @@ static PHP_INI_MH(OnUpdateTags)
val = strchr(key, '=');
if (val) {
char *q;
- int keylen;
+ size_t keylen;
*val++ = '\0';
for (q = key; *q; q++)
@@ -351,7 +351,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s
char *end, *q;
char *xp;
char *start;
- int rest;
+ size_t rest;
smart_str_appendl(&ctx->buf, newdata, newlen);
@@ -906,10 +906,13 @@ yy76:
stop:
- rest = YYLIMIT - start;
- scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest));
- /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */
- if (rest < 0) rest = 0;
+ if (YYLIMIT < start) {
+ /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */
+ rest = 0;
+ } else {
+ rest = YYLIMIT - start;
+ scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest));
+ }
if (rest) memmove(ctx->buf.s->val, start, rest);
ctx->buf.s->len = rest;
@@ -993,7 +996,7 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D)
return SUCCESS;
}
-static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC)
+static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode TSRMLS_DC)
{
size_t len;
@@ -1023,7 +1026,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char *
}
}
-PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC)
+PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC)
{
smart_str val = {0};
zend_string *encoded;
diff --git a/ext/standard/url_scanner_ex.h b/ext/standard/url_scanner_ex.h
index 3c5b68c95b..2a9b6921bf 100644
--- a/ext/standard/url_scanner_ex.h
+++ b/ext/standard/url_scanner_ex.h
@@ -28,7 +28,7 @@ PHP_RINIT_FUNCTION(url_scanner_ex);
PHP_RSHUTDOWN_FUNCTION(url_scanner_ex);
PHPAPI char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC);
-PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC);
+PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC);
PHPAPI int php_url_scanner_reset_vars(TSRMLS_D);
#include "zend_smart_str_public.h"
diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re
index 2e74b1fb30..fed628f089 100644
--- a/ext/standard/url_scanner_ex.re
+++ b/ext/standard/url_scanner_ex.re
@@ -77,7 +77,7 @@ static PHP_INI_MH(OnUpdateTags)
val = strchr(key, '=');
if (val) {
char *q;
- int keylen;
+ size_t keylen;
*val++ = '\0';
for (q = key; *q; q++)
@@ -287,7 +287,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s
char *end, *q;
char *xp;
char *start;
- int rest;
+ size_t rest;
smart_str_appendl(&ctx->buf, newdata, newlen);
@@ -358,10 +358,13 @@ state_val:
*/
stop:
- rest = YYLIMIT - start;
- scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest));
- /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */
- if (rest < 0) rest = 0;
+ if (YYLIMIT < start) {
+ /* XXX: Crash avoidance. Need to work with reporter to figure out what goes wrong */
+ rest = 0;
+ } else {
+ rest = YYLIMIT - start;
+ scdebug(("stopped in state %d at pos %d (%d:%c) %d\n", STATE, YYCURSOR - ctx->buf.c, *YYCURSOR, *YYCURSOR, rest));
+ }
if (rest) memmove(ctx->buf.s->val, start, rest);
ctx->buf.s->len = rest;
@@ -445,7 +448,7 @@ static int php_url_scanner_ex_deactivate(TSRMLS_D)
return SUCCESS;
}
-static void php_url_scanner_output_handler(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC)
+static void php_url_scanner_output_handler(char *output, size_t output_len, char **handled_output, size_t *handled_output_len, int mode TSRMLS_DC)
{
size_t len;
@@ -475,7 +478,7 @@ static void php_url_scanner_output_handler(char *output, uint output_len, char *
}
}
-PHPAPI int php_url_scanner_add_var(char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC)
+PHPAPI int php_url_scanner_add_var(char *name, size_t name_len, char *value, size_t value_len, int urlencode TSRMLS_DC)
{
smart_str val = {0};
zend_string *encoded;
diff --git a/ext/standard/user_filters.c b/ext/standard/user_filters.c
index 19e8e454df..f310e64ae9 100644
--- a/ext/standard/user_filters.c
+++ b/ext/standard/user_filters.c
@@ -221,7 +221,7 @@ php_stream_filter_status_t userfilter_filter(
if (call_result == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
convert_to_long(&retval);
- ret = Z_LVAL(retval);
+ ret = (int)Z_LVAL(retval);
} else if (call_result == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to call filter function");
}
@@ -287,7 +287,7 @@ static php_stream_filter *user_filter_factory_create(const char *filtername,
return NULL;
}
- len = strlen(filtername);
+ len = (int)strlen(filtername);
/* determine the classname/class entry */
if (NULL == (fdat = zend_hash_str_find_ptr(BG(user_filter_map), (char*)filtername, len))) {
diff --git a/ext/wddx/php_wddx_api.h b/ext/wddx/php_wddx_api.h
index 5c47109ee3..edbd013342 100644
--- a/ext/wddx/php_wddx_api.h
+++ b/ext/wddx/php_wddx_api.h
@@ -61,7 +61,7 @@ void php_wddx_packet_start(wddx_packet *packet, char *comment, size_t comment
void php_wddx_packet_end(wddx_packet *packet);
void php_wddx_serialize_var(wddx_packet *packet, zval *var, zend_string *name TSRMLS_DC);
-int php_wddx_deserialize_ex(char *, int, zval *return_value);
+int php_wddx_deserialize_ex(const char *, size_t, zval *return_value);
#define php_wddx_gather(packet) estrndup(packet->c, packet->len)
#endif /* PHP_WDDX_API_H */
diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c
index 705babd885..43deb15afd 100644
--- a/ext/wddx/wddx.c
+++ b/ext/wddx/wddx.c
@@ -1046,7 +1046,7 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len)
/* {{{ php_wddx_deserialize_ex
*/
-int php_wddx_deserialize_ex(char *value, int vallen, zval *return_value)
+int php_wddx_deserialize_ex(const char *value, size_t vallen, zval *return_value)
{
wddx_stack stack;
XML_Parser parser;
@@ -1060,7 +1060,8 @@ int php_wddx_deserialize_ex(char *value, int vallen, zval *return_value)
XML_SetElementHandler(parser, php_wddx_push_element, php_wddx_pop_element);
XML_SetCharacterDataHandler(parser, php_wddx_process_data);
- XML_Parse(parser, value, vallen, 1);
+ /* XXX value should be parsed in the loop to exhaust size_t */
+ XML_Parse(parser, value, (int)vallen, 1);
XML_ParserFree(parser);
diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c
index fed73bbfa8..a97b09b303 100644
--- a/ext/xmlrpc/libxmlrpc/xmlrpc.c
+++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c
@@ -201,9 +201,13 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
}
p++;
}
- text = buf;
+ *p2 = 0;
+ text = buf;
}
+ if (strlen(text)<17) {
+ return -1;
+ }
tm.tm_isdst = -1;
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 34a425a844..ffde50ba0b 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -34,6 +34,18 @@
#include "ext/standard/php_string.h"
#include "php_zlib.h"
+/*
+ * zlib include files can define the following preprocessor defines which rename
+ * the corresponding PHP functions to gzopen64, gzseek64 and gztell64 and thereby
+ * breaking some software, most notably PEAR's Archive_Tar, which halts execution
+ * without error message on gzip compressed archivesa.
+ *
+ * This only seems to happen on 32bit systems with large file support.
+ */
+#undef gzopen
+#undef gzseek
+#undef gztell
+
ZEND_DECLARE_MODULE_GLOBALS(zlib);
/* {{{ Memory management wrappers */