From 88412772d295ebf7dd34409534507dc9bcac726e Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 28 Sep 2014 17:33:44 -0700 Subject: Fix bug #68027 - fix date parsing in XMLRPC lib --- ext/xmlrpc/libxmlrpc/xmlrpc.c | 13 ++++++++----- ext/xmlrpc/tests/bug68027.phpt | 44 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 5 deletions(-) create mode 100644 ext/xmlrpc/tests/bug68027.phpt (limited to 'ext') diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c index ce70c2afd9..b766a5495a 100644 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.c +++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c @@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_mon = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+4]) tm.tm_mon += (text[i+4]-'0')*n; n /= 10; } tm.tm_mon --; + if(tm.tm_mon < 0 || tm.tm_mon > 11) { + return -1; + } n = 10; tm.tm_mday = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+6]) tm.tm_mday += (text[i+6]-'0')*n; n /= 10; } @@ -236,7 +239,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_hour = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+9]) tm.tm_hour += (text[i+9]-'0')*n; n /= 10; } @@ -244,7 +247,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_min = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+12]) tm.tm_min += (text[i+12]-'0')*n; n /= 10; } @@ -252,7 +255,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) { n = 10; tm.tm_sec = 0; for(i = 0; i < 2; i++) { - XMLRPC_IS_NUMBER(text[i]) + XMLRPC_IS_NUMBER(text[i+15]) tm.tm_sec += (text[i+15]-'0')*n; n /= 10; } diff --git a/ext/xmlrpc/tests/bug68027.phpt b/ext/xmlrpc/tests/bug68027.phpt new file mode 100644 index 0000000000..a5c96f1cf2 --- /dev/null +++ b/ext/xmlrpc/tests/bug68027.phpt @@ -0,0 +1,44 @@ +--TEST-- +Bug #68027 (buffer overflow in mkgmtime() function) +--SKIPIF-- + +--FILE-- +$datetime"); +print_r($obj); + +$datetime = "34770-0-08T21:46:40-0400"; +$obj = xmlrpc_decode("$datetime"); +print_r($obj); + +echo "Done\n"; +?> +--EXPECTF-- +object(stdClass)#1 (3) { + ["scalar"]=> + string(16) "6-01-01 20:00:00" + ["xmlrpc_type"]=> + string(8) "datetime" + ["timestamp"]=> + int(%d) +} +stdClass Object +( + [scalar] => 2001-0-08T21:46:40-0400 + [xmlrpc_type] => datetime + [timestamp] => %s +) +stdClass Object +( + [scalar] => 34770-0-08T21:46:40-0400 + [xmlrpc_type] => datetime + [timestamp] => %d +) +Done -- cgit v1.2.1 From 56754a7f9eba0e4f559b6ca081d9f2a447b3f159 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 28 Sep 2014 14:19:31 -0700 Subject: Fixed bug #68044: Integer overflow in unserialize() (32-bits only) --- ext/standard/tests/serialize/bug68044.phpt | 12 ++++++++++++ ext/standard/var_unserializer.c | 4 ++-- ext/standard/var_unserializer.re | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 ext/standard/tests/serialize/bug68044.phpt (limited to 'ext') diff --git a/ext/standard/tests/serialize/bug68044.phpt b/ext/standard/tests/serialize/bug68044.phpt new file mode 100644 index 0000000000..031e44e149 --- /dev/null +++ b/ext/standard/tests/serialize/bug68044.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #68044 Integer overflow in unserialize() (32-bits only) +--FILE-- + +===DONE== +--EXPECTF-- +Warning: Insufficient data for unserializing - %d required, 1 present in %s/bug68044.php on line 2 + +Notice: unserialize(): Error at offset 32 of 33 bytes in %s/bug68044.php on line 2 +===DONE== diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 657051f6f7..8129da3d82 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Sat Jun 21 21:27:56 2014 */ +/* Generated by re2c 0.13.5 */ #line 1 "ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ @@ -372,7 +372,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) (*p) += 2; - if (datalen < 0 || (*p) + datalen >= max) { + if (datalen < 0 || (max - (*p)) <= datalen) { zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p))); return 0; } diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index 130750805f..6de158392e 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -376,7 +376,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce) (*p) += 2; - if (datalen < 0 || (*p) + datalen >= max) { + if (datalen < 0 || (max - (*p)) <= datalen) { zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p))); return 0; } -- cgit v1.2.1 From ab0939e5e5449cba04b02fff3a5595f725bce0a0 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 28 Sep 2014 17:53:49 -0700 Subject: Fix bug #68089 - do not accept options with embedded \0 Conflicts: ext/curl/interface.c --- ext/curl/interface.c | 6 ++++++ ext/curl/tests/bug68089.phpt | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 ext/curl/tests/bug68089.phpt (limited to 'ext') diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 8915625047..23b125238d 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -170,6 +170,12 @@ static int php_curl_option_url(php_curl *ch, const char *url, const int len TSRM #if LIBCURL_VERSION_NUM < 0x071100 char *copystr = NULL; #endif + + if (strlen(url) != len) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)"); + return 0; + } + /* Disable file:// if open_basedir are used */ if (PG(open_basedir) && *PG(open_basedir)) { #if LIBCURL_VERSION_NUM >= 0x071304 diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt new file mode 100644 index 0000000000..3bd5889709 --- /dev/null +++ b/ext/curl/tests/bug68089.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #68089 (NULL byte injection - cURL lib) +--SKIPIF-- + +--FILE-- + +Done +--EXPECTF-- +Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s/bug68089.php on line 4 +bool(false) +Done -- cgit v1.2.1 From 287c91c1f060dc85a8bdb51488c50db8614448b7 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 28 Sep 2014 16:57:42 -0700 Subject: Fix bug #68113 (Heap corruption in exif_thumbnail()) --- ext/exif/exif.c | 4 ++-- ext/exif/tests/bug68113.jpg | Bin 0 -> 368 bytes ext/exif/tests/bug68113.phpt | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 ext/exif/tests/bug68113.jpg create mode 100644 ext/exif/tests/bug68113.phpt (limited to 'ext') diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 38907b4d94..637ebf9289 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -2426,11 +2426,11 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel data_ptr += 8; break; case TAG_FMT_SINGLE: - memmove(data_ptr, &info_data->value.f, byte_count); + memmove(data_ptr, &info_value->f, 4); data_ptr += 4; break; case TAG_FMT_DOUBLE: - memmove(data_ptr, &info_data->value.d, byte_count); + memmove(data_ptr, &info_value->d, 8); data_ptr += 8; break; } diff --git a/ext/exif/tests/bug68113.jpg b/ext/exif/tests/bug68113.jpg new file mode 100755 index 0000000000..3ce7a620fb Binary files /dev/null and b/ext/exif/tests/bug68113.jpg differ diff --git a/ext/exif/tests/bug68113.phpt b/ext/exif/tests/bug68113.phpt new file mode 100644 index 0000000000..0fa4c4aca8 --- /dev/null +++ b/ext/exif/tests/bug68113.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #68113 (Heap corruption in exif_thumbnail()) +--SKIPIF-- + +--FILE-- + +Done +--EXPECTF-- +Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2 + +Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2 +bool(false) +Done \ No newline at end of file -- cgit v1.2.1 From 1803228597e82218a8c105e67975bc50e6f5bf0d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 22 Oct 2014 15:37:04 +0200 Subject: Fix bug #68283: fileinfo: out-of-bounds read in elf note headers Upstream commit https://github.com/file/file/commit/39c7ac1106be844a5296d3eb5971946cc09ffda0 CVE -2014-3710 --- ext/fileinfo/libmagic/readelf.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext') diff --git a/ext/fileinfo/libmagic/readelf.c b/ext/fileinfo/libmagic/readelf.c index 1c3845fc6b..bb6f70fb8b 100644 --- a/ext/fileinfo/libmagic/readelf.c +++ b/ext/fileinfo/libmagic/readelf.c @@ -372,6 +372,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; -- cgit v1.2.1 From 560649283cdd6b2c48a8fcd9e62f3de4f92d969f Mon Sep 17 00:00:00 2001 From: STANLEY SUFFICOOL Date: Wed, 22 Oct 2014 23:14:23 -0700 Subject: Implement Bug #66062 - pdo_dblib enable timeout parameter --- ext/pdo_dblib/dblib_driver.c | 39 +++++++++++++++++++++++++++++++-------- ext/pdo_dblib/pdo_dblib.c | 28 +++++----------------------- ext/pdo_dblib/php_pdo_dblib_int.h | 6 +++--- 3 files changed, 39 insertions(+), 34 deletions(-) (limited to 'ext') diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index 40d4114879..323c805fca 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -61,7 +61,6 @@ static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS msg, einfo->dberr, einfo->severity, stmt ? stmt->active_query_string : ""); add_next_index_long(info, einfo->dberr); - // TODO: avoid reallocation ??? add_next_index_string(info, message); efree(message); add_next_index_long(info, einfo->oserr); @@ -145,10 +144,12 @@ 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) { - pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; + + /* pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; */ + char *q; int l = 1; - + *quoted = q = safe_emalloc(2, unquotedlen, 3); *q++ = '\''; @@ -174,7 +175,6 @@ static int dblib_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, int unquote static int pdo_dblib_transaction_cmd(const char *cmd, pdo_dbh_t *dbh TSRMLS_DC) { pdo_dblib_db_handle *H = (pdo_dblib_db_handle *)dbh->driver_data; - RETCODE ret; if (FAIL == dbcmd(H->link, cmd)) { return 0; @@ -246,6 +246,23 @@ char *dblib_handle_last_id(pdo_dbh_t *dbh, const char *name, unsigned int *len T return id; } +static int dblib_set_attr(pdo_dbh_t *dbh, zend_long attr, zval *val TSRMLS_DC) +{ + switch(attr) { + case PDO_ATTR_TIMEOUT: + return 0; + default: + return 1; + } + +} + +static int dblib_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *return_value TSRMLS_DC) +{ + /* dblib_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; */ + return 0; +} + static struct pdo_dbh_methods dblib_methods = { dblib_handle_closer, dblib_handle_preparer, @@ -254,10 +271,10 @@ static struct pdo_dbh_methods dblib_methods = { dblib_handle_begin, /* begin */ dblib_handle_commit, /* commit */ dblib_handle_rollback, /* rollback */ - NULL, /*set attr */ + dblib_set_attr, /*set attr */ dblib_handle_last_id, /* last insert id */ dblib_fetch_error, /* fetch error */ - NULL, /* get attr */ + dblib_get_attribute, /* get attr */ NULL, /* check liveness */ NULL, /* get driver methods */ NULL, /* request shutdown */ @@ -303,6 +320,12 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ php_pdo_parse_data_source(dbh->data_source, dbh->data_source_len, vars, nvars); + if (driver_options) { + int timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30 TSRMLS_CC); + dbsetlogintime(timeout); /* Connection/Login Timeout */ + dbsettime(timeout); /* Statement Timeout */ + } + H = pecalloc(1, sizeof(*H), dbh->is_persistent); H->login = dblogin(); H->err.sqlstate = dbh->error_code; @@ -311,8 +334,8 @@ static int pdo_dblib_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_ goto cleanup; } - DBERRHANDLE(H->login, (EHANDLEFUNC) error_handler); - DBMSGHANDLE(H->login, (MHANDLEFUNC) msg_handler); + DBERRHANDLE(H->login, (EHANDLEFUNC) pdo_dblib_error_handler); + DBMSGHANDLE(H->login, (MHANDLEFUNC) pdo_dblib_msg_handler); if(vars[5].optval) { for(i=0;iseverity = severity; einfo->oserr = oserr; einfo->dberr = dberr; + if (einfo->oserrstr) { efree(einfo->oserrstr); } @@ -128,16 +129,10 @@ int error_handler(DBPROCESS *dbproc, int severity, int dberr, } strcpy(einfo->sqlstate, state); -#if 0 - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "dblib error: %d %s (severity %d)", - dberr, dberrstr, severity); -#endif - return INT_CANCEL; } -int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, +int pdo_dblib_msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line) { pdo_dblib_err *einfo; @@ -156,10 +151,6 @@ int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, einfo->lastmsg = estrdup(msgtext); } -#if 0 - php_error_docref(NULL TSRMLS_CC, E_WARNING, "dblib message: %s (severity %d)", msgtext, severity); -#endif - return 0; } @@ -196,18 +187,9 @@ PHP_MINIT_FUNCTION(pdo_dblib) return FAILURE; } - /* TODO: - - dbsetifile() - dbsetmaxprocs() - dbsetlogintime() - dbsettime() - - */ - #if !PHP_DBLIB_IS_MSSQL - dberrhandle(error_handler); - dbmsghandle(msg_handler); + dberrhandle((EHANDLEFUNC) pdo_dblib_error_handler); + dbmsghandle((MHANDLEFUNC) pdo_dblib_msg_handler); #endif return SUCCESS; diff --git a/ext/pdo_dblib/php_pdo_dblib_int.h b/ext/pdo_dblib/php_pdo_dblib_int.h index e247b5c19e..3b341478d7 100644 --- a/ext/pdo_dblib/php_pdo_dblib_int.h +++ b/ext/pdo_dblib/php_pdo_dblib_int.h @@ -37,7 +37,7 @@ # define DBSETOPT(a, b, c) dbsetopt(a, b, c) # define SYBESMSG SQLESMSG # define SYBESEOF SQLESEOF -# define SYBEFCON SQLECONN // SQLEFCON does not exist in MS SQL Server. +# define SYBEFCON SQLECONN /* SQLEFCON does not exist in MS SQL Server. */ # define SYBEMEM SQLEMEM # define SYBEPWD SQLEPWD @@ -89,10 +89,10 @@ typedef unsigned char *LPBYTE; typedef float DBFLT4; #endif -int error_handler(DBPROCESS *dbproc, int severity, int dberr, +int pdo_dblib_error_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr); -int msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, +int pdo_dblib_msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate, int severity, char *msgtext, char *srvname, char *procname, DBUSMALLINT line); extern pdo_driver_t pdo_dblib_driver; -- cgit v1.2.1 From a1a18fca6e2a1690ea113dc2ebe0e7d22fdc71a0 Mon Sep 17 00:00:00 2001 From: STANLEY SUFFICOOL Date: Fri, 24 Oct 2014 20:10:04 -0700 Subject: Fixed Bug #52885 - PDO_DBLIB: Binary data may be truncated Data containing characters in conflict with the server codepage or containing null char will throw an error. Implement binary quoting to allow binding of binary values. --- ext/pdo_dblib/dblib_driver.c | 69 ++++++++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 21 deletions(-) (limited to 'ext') 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 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>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;ilink, 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} -- cgit v1.2.1 From f35e6a839463b2aa98bf6f6036ebfcc9ff465c3d Mon Sep 17 00:00:00 2001 From: STANLEY SUFFICOOL Date: Fri, 24 Oct 2014 20:30:18 -0700 Subject: Update PDO_DBLIB README file --- ext/pdo_dblib/README | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'ext') 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) + -- cgit v1.2.1 From 5b295bf19161b14d6c81151fd89c2f17bd50525c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 22 Oct 2014 15:37:04 +0200 Subject: Fix bug #68283: fileinfo: out-of-bounds read in elf note headers Upstream commit https://github.com/file/file/commit/39c7ac1106be844a5296d3eb5971946cc09ffda0 CVE -2014-3710 (cherry picked from commit 1803228597e82218a8c105e67975bc50e6f5bf0d) --- ext/fileinfo/libmagic/readelf.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext') diff --git a/ext/fileinfo/libmagic/readelf.c b/ext/fileinfo/libmagic/readelf.c index 1c3845fc6b..bb6f70fb8b 100644 --- a/ext/fileinfo/libmagic/readelf.c +++ b/ext/fileinfo/libmagic/readelf.c @@ -372,6 +372,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; -- cgit v1.2.1 From 270df3ffd6c29296a32899690dcb6dbf29cba693 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 25 Oct 2014 12:01:58 +0200 Subject: updated libmagic.patch in 5.5 --- ext/fileinfo/libmagic.patch | 204 +++++++++++++++++++++++++++++++++----------- 1 file changed, 156 insertions(+), 48 deletions(-) (limited to 'ext') diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch index a91a658397..14409852bf 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 Thu Mar 21 18:45:14 2013 -+++ libmagic/apprentice.c Mon Apr 14 23:42:51 2014 ++++ libmagic/apprentice.c Mon Sep 29 10:53:07 2014 @@ -29,6 +29,8 @@ * apprentice - make one pass through /etc/magic, learning its secrets. */ @@ -479,6 +479,15 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c return NULL; } return map; +@@ -1233,7 +1269,7 @@ + * the sign extension must have happened. + */ + case FILE_BYTE: +- v = (char) v; ++ v = (signed char) v; + break; + case FILE_SHORT: + case FILE_BESHORT: @@ -1500,7 +1536,7 @@ if (me->cont_count == me->max_count) { struct magic *nm; @@ -833,7 +842,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c } diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c --- libmagic.orig/ascmagic.c Wed Oct 31 18:03:01 2012 -+++ libmagic/ascmagic.c Mon Apr 14 23:42:51 2014 ++++ libmagic/ascmagic.c Mon Mar 10 16:40:55 2014 @@ -139,7 +139,7 @@ /* malloc size is a conservative overestimate; could be improved, or at least realloced after conversion. */ @@ -872,7 +881,7 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c } diff -u libmagic.orig/cdf.c libmagic/cdf.c --- libmagic.orig/cdf.c Thu Mar 21 18:45:14 2013 -+++ libmagic/cdf.c Tue Jul 1 09:00:09 2014 ++++ libmagic/cdf.c Wed Aug 20 21:20:34 2014 @@ -43,7 +43,17 @@ #include #endif @@ -955,7 +964,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c errno = EFTYPE; return (size_t)-1; } -@@ -796,7 +812,11 @@ +@@ -796,11 +812,15 @@ if (cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1) goto out; for (i = 0; i < sh.sh_properties; i++) { @@ -968,6 +977,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 +830,10 @@ i, inp[i].pi_id, inp[i].pi_type, q - p, offs)); if (inp[i].pi_type & CDF_VECTOR) { @@ -1056,7 +1070,7 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c } else { diff -u libmagic.orig/cdf.h libmagic/cdf.h --- libmagic.orig/cdf.h Wed Oct 31 18:03:01 2012 -+++ libmagic/cdf.h Mon Apr 14 23:32:55 2014 ++++ libmagic/cdf.h Mon Dec 2 15:25:29 2013 @@ -35,10 +35,12 @@ #ifndef _H_CDF_ #define _H_CDF_ @@ -1099,7 +1113,7 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h void cdf_unpack_header(cdf_header_t *, char *); diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c --- libmagic.orig/cdf_time.c Wed Oct 31 18:03:01 2012 -+++ libmagic/cdf_time.c Mon Apr 14 23:32:55 2014 ++++ libmagic/cdf_time.c Mon Dec 2 15:25:29 2013 @@ -96,7 +96,7 @@ } @@ -1159,7 +1173,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 6 21:35:43 2013 -+++ libmagic/compress.c Mon Apr 14 23:42:51 2014 ++++ libmagic/compress.c Mon Dec 2 15:25:29 2013 @@ -32,6 +32,7 @@ * uncompress(method, old, n, newch) - uncompress old into new, * using method, return sizeof new @@ -1322,7 +1336,7 @@ diff -u libmagic.orig/compress.c libmagic/compress.c +#endif /* if PHP_FILEINFO_UNCOMPRESS */ diff -u libmagic.orig/file.h libmagic/file.h --- libmagic.orig/file.h Mon Feb 18 16:40:59 2013 -+++ libmagic/file.h Mon Apr 14 23:42:51 2014 ++++ libmagic/file.h Mon Mar 10 16:40:55 2014 @@ -33,11 +33,9 @@ #ifndef __file_h__ #define __file_h__ @@ -1532,7 +1546,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 Thu Mar 21 18:45:14 2013 -+++ libmagic/fsmagic.c Mon Apr 14 23:42:51 2014 ++++ libmagic/fsmagic.c Mon Dec 2 15:25:29 2013 @@ -59,27 +59,21 @@ # define minor(dev) ((dev) & 0xff) #endif @@ -1899,7 +1913,7 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c } diff -u libmagic.orig/funcs.c libmagic/funcs.c --- libmagic.orig/funcs.c Wed Oct 31 18:03:01 2012 -+++ libmagic/funcs.c Mon Apr 14 23:42:51 2014 ++++ libmagic/funcs.c Mon Mar 10 16:40:55 2014 @@ -41,52 +41,42 @@ #if defined(HAVE_WCTYPE_H) #include @@ -2193,7 +2207,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c + diff -u libmagic.orig/magic.c libmagic/magic.c --- libmagic.orig/magic.c Fri Jan 11 17:43:09 2013 -+++ libmagic/magic.c Mon Apr 14 23:42:51 2014 ++++ libmagic/magic.c Mon Dec 2 15:29:02 2013 @@ -25,11 +25,6 @@ * SUCH DAMAGE. */ @@ -2537,7 +2551,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 Thu Mar 21 18:52:42 2013 -+++ libmagic/magic.h Mon Apr 14 23:42:51 2014 ++++ libmagic/magic.h Mon Dec 2 15:25:29 2013 @@ -87,6 +87,7 @@ const char *magic_getpath(const char *, int); @@ -2556,14 +2570,14 @@ diff -u libmagic.orig/magic.h libmagic/magic.h diff -u libmagic.orig/print.c libmagic/print.c --- libmagic.orig/print.c Thu Mar 21 18:45:14 2013 -+++ libmagic/print.c Mon Apr 14 23:42:51 2014 -@@ -29,12 +29,17 @@ ++++ libmagic/print.c Mon Dec 2 15:29:02 2013 +@@ -28,13 +28,17 @@ + /* * print.c - debugging printout routines */ - +#define _GNU_SOURCE +#include "php.h" -+ + #include "file.h" +#include "cdf.h" @@ -2575,7 +2589,7 @@ diff -u libmagic.orig/print.c libmagic/print.c #include #include #include -@@ -43,188 +48,28 @@ +@@ -43,188 +47,28 @@ #endif #include @@ -2776,7 +2790,7 @@ diff -u libmagic.orig/print.c libmagic/print.c } protected const char * -@@ -235,7 +80,7 @@ +@@ -235,7 +79,7 @@ struct tm *tm; if (flags & FILE_T_WINDOWS) { @@ -2787,7 +2801,7 @@ diff -u libmagic.orig/print.c libmagic/print.c } diff -u libmagic.orig/readcdf.c libmagic/readcdf.c --- libmagic.orig/readcdf.c Wed Oct 31 18:03:01 2012 -+++ libmagic/readcdf.c Tue May 27 22:17:37 2014 ++++ libmagic/readcdf.c Thu Apr 24 19:54:40 2014 @@ -30,7 +30,11 @@ #endif @@ -2863,7 +2877,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c return -1; diff -u libmagic.orig/readelf.c libmagic/readelf.c --- libmagic.orig/readelf.c Thu Mar 21 18:45:14 2013 -+++ libmagic/readelf.c Mon Apr 14 23:42:51 2014 ++++ libmagic/readelf.c Sat Oct 25 11:50:05 2014 @@ -48,8 +48,8 @@ private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t, off_t, int *, int); @@ -2956,7 +2970,21 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badread(ms); return -1; } -@@ -852,24 +867,12 @@ +@@ -357,6 +372,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; + +@@ -852,24 +874,12 @@ return 0; } @@ -2984,7 +3012,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badread(ms); return -1; } -@@ -894,14 +897,17 @@ +@@ -894,14 +904,17 @@ /* Things we can determine when we seek */ switch (xsh_type) { case SHT_NOTE: @@ -3007,7 +3035,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c return -1; } -@@ -910,25 +916,16 @@ +@@ -910,25 +923,16 @@ if (noff >= (off_t)xsh_size) break; noff = donote(ms, nbuf, (size_t)noff, @@ -3038,7 +3066,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badseek(ms); return -1; } -@@ -940,7 +937,7 @@ +@@ -940,7 +944,7 @@ MAX(sizeof cap32, sizeof cap64)]; if ((coff += xcap_sizeof) > (off_t)xsh_size) break; @@ -3047,7 +3075,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c (ssize_t)xcap_sizeof) { file_badread(ms); return -1; -@@ -966,13 +963,12 @@ +@@ -966,13 +970,12 @@ break; } } @@ -3063,7 +3091,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (file_printf(ms, ", %sstripped", stripped ? "" : "not ") == -1) return -1; if (cap_hw1) { -@@ -1051,7 +1047,7 @@ +@@ -1051,7 +1054,7 @@ const char *shared_libraries = ""; unsigned char nbuf[BUFSIZ]; ssize_t bufsize; @@ -3072,7 +3100,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (size != xph_sizeof) { if (file_printf(ms, ", corrupted program header size") == -1) -@@ -1060,8 +1056,13 @@ +@@ -1060,8 +1063,13 @@ } for ( ; num; num--) { @@ -3088,7 +3116,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c return -1; } -@@ -1099,9 +1100,12 @@ +@@ -1099,9 +1107,12 @@ * This is a PT_NOTE section; loop through all the notes * in the section. */ @@ -3104,7 +3132,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (bufsize == -1) { file_badread(ms); return -1; -@@ -1162,7 +1166,7 @@ +@@ -1162,7 +1173,7 @@ /* * If we cannot seek, it must be a pipe, socket or fifo. */ @@ -3115,7 +3143,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (fstat(fd, &st) == -1) { diff -u libmagic.orig/readelf.h libmagic/readelf.h --- libmagic.orig/readelf.h Thu Mar 21 18:45:14 2013 -+++ libmagic/readelf.h Mon Apr 14 23:42:51 2014 ++++ libmagic/readelf.h Mon Dec 2 15:25:29 2013 @@ -44,9 +44,17 @@ typedef uint32_t Elf32_Word; typedef uint8_t Elf32_Char; @@ -3136,7 +3164,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 Mar 21 18:45:14 2013 -+++ libmagic/softmagic.c Tue Jul 1 09:00:09 2014 ++++ libmagic/softmagic.c Wed Aug 20 21:20:34 2014 @@ -41,6 +41,11 @@ #include #include @@ -3149,6 +3177,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 *, +@@ -53,7 +58,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 *); @@ -62,6 +67,8 @@ private void cvt_32(union VALUETYPE *, const struct magic *); private void cvt_64(union VALUETYPE *, const struct magic *); @@ -3308,9 +3345,72 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c while (len--) *ptr1++ = *ptr2++; *ptr1 = '\0'; -@@ -1145,9 +1138,6 @@ - "nbytes=%zu, count=%u)\n", m->type, m->flag, offset, o, - nbytes, count); +@@ -1010,7 +1003,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 +@@ -1030,15 +1023,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 *, +@@ -1051,7 +1053,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; +@@ -1125,7 +1127,6 @@ + int *need_separator, int *returnval) + { + uint32_t soffset, offset = ms->offset; +- uint32_t count = m->str_range; + int rv, oneed_separator; + char *sbuf, *rbuf; + union VALUETYPE *p = &ms->ms_value; +@@ -1137,17 +1138,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); @@ -3318,7 +3418,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } if (m->flag & INDIR) { -@@ -1191,7 +1181,7 @@ +@@ -1191,7 +1188,7 @@ } switch (cvt_flip(m->in_type, flip)) { case FILE_BYTE: @@ -3327,7 +3427,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1226,7 +1216,7 @@ +@@ -1226,7 +1223,7 @@ offset = ~offset; break; case FILE_BESHORT: @@ -3336,7 +3436,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1278,7 +1268,7 @@ +@@ -1278,7 +1275,7 @@ offset = ~offset; break; case FILE_LESHORT: @@ -3345,7 +3445,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1330,7 +1320,7 @@ +@@ -1330,7 +1327,7 @@ offset = ~offset; break; case FILE_SHORT: @@ -3354,7 +3454,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1367,7 +1357,7 @@ +@@ -1367,7 +1364,7 @@ break; case FILE_BELONG: case FILE_BEID3: @@ -3363,7 +3463,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1438,7 +1428,7 @@ +@@ -1438,7 +1435,7 @@ break; case FILE_LELONG: case FILE_LEID3: @@ -3372,7 +3472,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1508,7 +1498,7 @@ +@@ -1508,7 +1505,7 @@ offset = ~offset; break; case FILE_MELONG: @@ -3381,7 +3481,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1578,7 +1568,7 @@ +@@ -1578,7 +1575,7 @@ offset = ~offset; break; case FILE_LONG: @@ -3390,7 +3490,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; if (off) { switch (m->in_op & FILE_OPS_MASK) { -@@ -1644,23 +1634,20 @@ +@@ -1637,30 +1634,27 @@ + 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)); @@ -3416,7 +3524,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; break; -@@ -1679,38 +1666,40 @@ +@@ -1679,38 +1673,40 @@ case FILE_FLOAT: case FILE_BEFLOAT: case FILE_LEFLOAT: @@ -3463,7 +3571,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c if ((ms->flags & MAGIC_DEBUG) != 0) fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv); rbuf = ms->o.buf; -@@ -1718,16 +1707,26 @@ +@@ -1718,16 +1714,26 @@ ms->offset = soffset; if (rv == 1) { if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && @@ -3494,7 +3602,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c return 0; sbuf = m->value.s; if (*sbuf == '^') { -@@ -1837,6 +1836,42 @@ +@@ -1837,6 +1843,42 @@ return file_strncmp(a, b, len, flags); } @@ -3537,7 +3645,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private int magiccheck(struct magic_set *ms, struct magic *m) { -@@ -1996,69 +2031,157 @@ +@@ -1996,69 +2038,157 @@ break; } case FILE_REGEX: { @@ -3608,7 +3716,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c + zval *retval; + zval *subpats; + char *haystack; -+ ++ + MAKE_STD_ZVAL(retval); + ALLOC_INIT_ZVAL(subpats); + -- cgit v1.2.1 From 7e5bd4ec69b5c026afc95d17009b91b0f08064a9 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 25 Oct 2014 12:03:49 +0200 Subject: updated libmagic.patch in 5.6 --- ext/fileinfo/libmagic.patch | 237 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 194 insertions(+), 43 deletions(-) (limited to 'ext') diff --git a/ext/fileinfo/libmagic.patch b/ext/fileinfo/libmagic.patch index 8b0b9a8911..2d987e4573 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 Fri Oct 3 22:48:34 2014 @@ -29,6 +29,8 @@ * apprentice - make one pass through /etc/magic, learning its secrets. */ @@ -454,6 +454,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; @@ -822,7 +831,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 Fri Oct 3 22:48:34 2014 @@ -35,7 +35,7 @@ #include "file.h" @@ -937,7 +946,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 +959,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) { @@ -1814,7 +1828,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 Fri Oct 3 22:48:34 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 @@ -1947,7 +1970,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 +2003,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 +2026,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 +2043,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 +2057,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 +2066,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 +2083,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 +2094,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,50 @@ return ms->o.buf == NULL ? 0 : strlen(ms->o.buf); } @@ -2706,7 +2757,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 Sat Oct 25 11:50:04 2014 @@ -26,11 +26,15 @@ #include "file.h" @@ -2724,7 +2775,7 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c #include #include #include -@@ -69,6 +73,44 @@ +@@ -69,6 +73,50 @@ { NULL, NULL, }, }; @@ -2743,6 +2794,9 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c + { 0x00000000000c1084LLU, 0x46000000000000c0LLU }, +#endif + "x-msi", ++ }, ++ { { 0, 0 }, ++ NULL, + } +}, clsid2desc[] = { + { @@ -2753,6 +2807,9 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c +#endif + "MSI Installer", + }, ++ { { 0, 0 }, ++ NULL, ++ } +}; + +private const char * @@ -2769,7 +2826,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 +2850,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 +2859,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 +2874,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 +2888,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 +2897,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 +2906,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 +2924,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 +2932,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 +2942,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,7 +2975,7 @@ 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 ++++ libmagic/readelf.c Sat Oct 25 11:50:04 2014 @@ -48,8 +48,8 @@ private int dophn_exec(struct magic_set *, int, int, int, off_t, int, size_t, off_t, int *, int); @@ -2983,7 +3040,21 @@ 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; + +@@ -913,24 +935,12 @@ return 0; } @@ -3011,7 +3082,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badread(ms); return -1; } -@@ -955,14 +958,17 @@ +@@ -955,14 +965,17 @@ /* Things we can determine when we seek */ switch (xsh_type) { case SHT_NOTE: @@ -3034,7 +3105,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c return -1; } -@@ -971,25 +977,16 @@ +@@ -971,25 +984,16 @@ if (noff >= (off_t)xsh_size) break; noff = donote(ms, nbuf, (size_t)noff, @@ -3065,7 +3136,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c file_badseek(ms); return -1; } -@@ -1001,7 +998,7 @@ +@@ -1001,7 +1005,7 @@ MAX(sizeof cap32, sizeof cap64)]; if ((coff += xcap_sizeof) > (off_t)xsh_size) break; @@ -3074,7 +3145,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c (ssize_t)xcap_sizeof) { file_badread(ms); return -1; -@@ -1027,13 +1024,12 @@ +@@ -1027,13 +1031,12 @@ break; } } @@ -3090,7 +3161,7 @@ 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 @@ +@@ -1112,7 +1115,7 @@ const char *shared_libraries = ""; unsigned char nbuf[BUFSIZ]; ssize_t bufsize; @@ -3099,7 +3170,7 @@ 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--) { @@ -3115,7 +3186,7 @@ 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. */ @@ -3131,7 +3202,7 @@ diff -u libmagic.orig/readelf.c libmagic/readelf.c if (bufsize == -1) { file_badread(ms); return -1; -@@ -1223,7 +1227,7 @@ +@@ -1223,7 +1234,7 @@ /* * If we cannot seek, it must be a pipe, socket or fifo. */ @@ -3163,7 +3234,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 Mon Aug 4 14:58:55 2014 @@ -50,6 +50,11 @@ #include #endif @@ -3176,6 +3247,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 *); @@ -3320,9 +3400,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 +1038,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 +1058,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 +1088,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 +1159,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 +1170,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 +3473,15 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } if (m->flag & INDIR) { -@@ -1679,9 +1668,6 @@ +@@ -1672,16 +1668,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 +3491,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } } -@@ -1755,11 +1741,21 @@ +@@ -1755,11 +1748,21 @@ ms->offset = soffset; if (rv == 1) { if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 && @@ -3365,7 +3516,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c } return rv; -@@ -1875,6 +1871,42 @@ +@@ -1875,6 +1878,42 @@ return file_strncmp(a, b, len, flags); } @@ -3408,7 +3559,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c private int magiccheck(struct magic_set *ms, struct magic *m) { -@@ -2035,63 +2067,151 @@ +@@ -2035,63 +2074,151 @@ break; } case FILE_REGEX: { @@ -3444,7 +3595,7 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c + zval *retval; + zval *subpats; + char *haystack; -+ ++ + MAKE_STD_ZVAL(retval); + ALLOC_INIT_ZVAL(subpats); + -- cgit v1.2.1 From 71a653452f4c6b95b940972a00674f7a3e386f75 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 25 Oct 2014 12:06:17 +0200 Subject: updated libmagic.patch in master --- ext/fileinfo/libmagic.patch | 767 +++++++++++++++++++++++++++++--------------- 1 file changed, 511 insertions(+), 256 deletions(-) (limited to 'ext') 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 #include #include -@@ -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 @@ -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 #include #include -@@ -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 #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; ival[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 */ -- cgit v1.2.1 From 22b9f16e9ad0f500b73fd6814feb6c00ce749f34 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Sun, 26 Oct 2014 10:54:07 -0400 Subject: - Updated to version 2014.9 (2014i) --- ext/date/lib/timezonedb.h | 773 +++++++++++++++++++++++----------------------- 1 file changed, 394 insertions(+), 379 deletions(-) (limited to 'ext') diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 98e7b2292c..0fd9bfbe10 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -1,4 +1,4 @@ -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 }, @@ -261,329 +261,330 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[582] = { { "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 }, + { "Asia/Hong_Kong" , 0x01B912 }, + { "Asia/Hovd" , 0x01BAD4 }, + { "Asia/Irkutsk" , 0x01BC4C }, + { "Asia/Istanbul" , 0x01BE37 }, + { "Asia/Jakarta" , 0x01C224 }, + { "Asia/Jayapura" , 0x01C2CE }, + { "Asia/Jerusalem" , 0x01C36B }, + { "Asia/Kabul" , 0x01C69A }, + { "Asia/Kamchatka" , 0x01C6EB }, + { "Asia/Karachi" , 0x01C8E4 }, + { "Asia/Kashgar" , 0x01C999 }, + { "Asia/Kathmandu" , 0x01C9EE }, + { "Asia/Katmandu" , 0x01CA54 }, + { "Asia/Khandyga" , 0x01CABA }, + { "Asia/Kolkata" , 0x01CCE4 }, + { "Asia/Krasnoyarsk" , 0x01CD5D }, + { "Asia/Kuala_Lumpur" , 0x01CF4A }, + { "Asia/Kuching" , 0x01D007 }, + { "Asia/Kuwait" , 0x01D0F5 }, + { "Asia/Macao" , 0x01D14A }, + { "Asia/Macau" , 0x01D285 }, + { "Asia/Magadan" , 0x01D3C0 }, + { "Asia/Makassar" , 0x01D5C4 }, + { "Asia/Manila" , 0x01D689 }, + { "Asia/Muscat" , 0x01D70E }, + { "Asia/Nicosia" , 0x01D763 }, + { "Asia/Novokuznetsk" , 0x01DA4B }, + { "Asia/Novosibirsk" , 0x01DC6B }, + { "Asia/Omsk" , 0x01DE5B }, + { "Asia/Oral" , 0x01E047 }, + { "Asia/Phnom_Penh" , 0x01E217 }, + { "Asia/Pontianak" , 0x01E26C }, + { "Asia/Pyongyang" , 0x01E32E }, + { "Asia/Qatar" , 0x01E3BE }, + { "Asia/Qyzylorda" , 0x01E424 }, + { "Asia/Rangoon" , 0x01E5FA }, + { "Asia/Riyadh" , 0x01E672 }, + { "Asia/Saigon" , 0x01E6C7 }, + { "Asia/Sakhalin" , 0x01E769 }, + { "Asia/Samarkand" , 0x01E966 }, + { "Asia/Seoul" , 0x01EA9C }, + { "Asia/Shanghai" , 0x01EB63 }, + { "Asia/Singapore" , 0x01EC0F }, + { "Asia/Srednekolymsk" , 0x01ECC6 }, + { "Asia/Taipei" , 0x01EEC6 }, + { "Asia/Tashkent" , 0x01EFF7 }, + { "Asia/Tbilisi" , 0x01F128 }, + { "Asia/Tehran" , 0x01F2E2 }, + { "Asia/Tel_Aviv" , 0x01F550 }, + { "Asia/Thimbu" , 0x01F87F }, + { "Asia/Thimphu" , 0x01F8E5 }, + { "Asia/Tokyo" , 0x01F94B }, + { "Asia/Ujung_Pandang" , 0x01F9D5 }, + { "Asia/Ulaanbaatar" , 0x01FA52 }, + { "Asia/Ulan_Bator" , 0x01FBAD }, + { "Asia/Urumqi" , 0x01FCFA }, + { "Asia/Ust-Nera" , 0x01FD5C }, + { "Asia/Vientiane" , 0x01FF6E }, + { "Asia/Vladivostok" , 0x01FFC3 }, + { "Asia/Yakutsk" , 0x0201AD }, + { "Asia/Yekaterinburg" , 0x020397 }, + { "Asia/Yerevan" , 0x0205B8 }, + { "Atlantic/Azores" , 0x0207B8 }, + { "Atlantic/Bermuda" , 0x020CBB }, + { "Atlantic/Canary" , 0x020F9C }, + { "Atlantic/Cape_Verde" , 0x021272 }, + { "Atlantic/Faeroe" , 0x0212EB }, + { "Atlantic/Faroe" , 0x02158F }, + { "Atlantic/Jan_Mayen" , 0x021833 }, + { "Atlantic/Madeira" , 0x021B65 }, + { "Atlantic/Reykjavik" , 0x02206E }, + { "Atlantic/South_Georgia" , 0x022227 }, + { "Atlantic/St_Helena" , 0x022439 }, + { "Atlantic/Stanley" , 0x02226B }, + { "Australia/ACT" , 0x02248E }, + { "Australia/Adelaide" , 0x0227B1 }, + { "Australia/Brisbane" , 0x022AE3 }, + { "Australia/Broken_Hill" , 0x022BB0 }, + { "Australia/Canberra" , 0x022EF4 }, + { "Australia/Currie" , 0x023217 }, + { "Australia/Darwin" , 0x023550 }, + { "Australia/Eucla" , 0x0235DC }, + { "Australia/Hobart" , 0x0236B8 }, + { "Australia/LHI" , 0x023A1C }, + { "Australia/Lindeman" , 0x023CBD }, + { "Australia/Lord_Howe" , 0x023DA4 }, + { "Australia/Melbourne" , 0x024055 }, + { "Australia/North" , 0x024380 }, + { "Australia/NSW" , 0x0243FA }, + { "Australia/Perth" , 0x02471D }, + { "Australia/Queensland" , 0x0247FB }, + { "Australia/South" , 0x0248AD }, + { "Australia/Sydney" , 0x024BD0 }, + { "Australia/Tasmania" , 0x024F13 }, + { "Australia/Victoria" , 0x02525E }, + { "Australia/West" , 0x025581 }, + { "Australia/Yancowinna" , 0x02563D }, + { "Brazil/Acre" , 0x025965 }, + { "Brazil/DeNoronha" , 0x025A69 }, + { "Brazil/East" , 0x025B89 }, + { "Brazil/West" , 0x025E66 }, + { "Canada/Atlantic" , 0x025F5E }, + { "Canada/Central" , 0x026446 }, + { "Canada/East-Saskatchewan" , 0x026D50 }, + { "Canada/Eastern" , 0x026860 }, + { "Canada/Mountain" , 0x026ED9 }, + { "Canada/Newfoundland" , 0x02724F }, + { "Canada/Pacific" , 0x02777A }, + { "Canada/Saskatchewan" , 0x027B93 }, + { "Canada/Yukon" , 0x027D1C }, + { "CET" , 0x02801F }, + { "Chile/Continental" , 0x028328 }, + { "Chile/EasterIsland" , 0x0286C3 }, + { "CST6CDT" , 0x028A05 }, + { "Cuba" , 0x028D56 }, + { "EET" , 0x0290C9 }, + { "Egypt" , 0x02937C }, + { "Eire" , 0x029763 }, + { "EST" , 0x029C74 }, + { "EST5EDT" , 0x029CB8 }, + { "Etc/GMT" , 0x02A009 }, + { "Etc/GMT+0" , 0x02A0D5 }, + { "Etc/GMT+1" , 0x02A15F }, + { "Etc/GMT+10" , 0x02A1EC }, + { "Etc/GMT+11" , 0x02A27A }, + { "Etc/GMT+12" , 0x02A308 }, + { "Etc/GMT+2" , 0x02A423 }, + { "Etc/GMT+3" , 0x02A4AF }, + { "Etc/GMT+4" , 0x02A53B }, + { "Etc/GMT+5" , 0x02A5C7 }, + { "Etc/GMT+6" , 0x02A653 }, + { "Etc/GMT+7" , 0x02A6DF }, + { "Etc/GMT+8" , 0x02A76B }, + { "Etc/GMT+9" , 0x02A7F7 }, + { "Etc/GMT-0" , 0x02A091 }, + { "Etc/GMT-1" , 0x02A119 }, + { "Etc/GMT-10" , 0x02A1A5 }, + { "Etc/GMT-11" , 0x02A233 }, + { "Etc/GMT-12" , 0x02A2C1 }, + { "Etc/GMT-13" , 0x02A34F }, + { "Etc/GMT-14" , 0x02A396 }, + { "Etc/GMT-2" , 0x02A3DD }, + { "Etc/GMT-3" , 0x02A469 }, + { "Etc/GMT-4" , 0x02A4F5 }, + { "Etc/GMT-5" , 0x02A581 }, + { "Etc/GMT-6" , 0x02A60D }, + { "Etc/GMT-7" , 0x02A699 }, + { "Etc/GMT-8" , 0x02A725 }, + { "Etc/GMT-9" , 0x02A7B1 }, + { "Etc/GMT0" , 0x02A04D }, + { "Etc/Greenwich" , 0x02A83D }, + { "Etc/UCT" , 0x02A881 }, + { "Etc/Universal" , 0x02A8C5 }, + { "Etc/UTC" , 0x02A909 }, + { "Etc/Zulu" , 0x02A94D }, + { "Europe/Amsterdam" , 0x02A991 }, + { "Europe/Andorra" , 0x02ADCF }, + { "Europe/Athens" , 0x02B04B }, + { "Europe/Belfast" , 0x02B38E }, + { "Europe/Belgrade" , 0x02B8C5 }, + { "Europe/Berlin" , 0x02BB8E }, + { "Europe/Bratislava" , 0x02BEF2 }, + { "Europe/Brussels" , 0x02C224 }, + { "Europe/Bucharest" , 0x02C65B }, + { "Europe/Budapest" , 0x02C985 }, + { "Europe/Busingen" , 0x02CCEE }, + { "Europe/Chisinau" , 0x02CFA5 }, + { "Europe/Copenhagen" , 0x02D333 }, + { "Europe/Dublin" , 0x02D63D }, + { "Europe/Gibraltar" , 0x02DB4E }, + { "Europe/Guernsey" , 0x02DFA5 }, + { "Europe/Helsinki" , 0x02E4DC }, + { "Europe/Isle_of_Man" , 0x02E792 }, + { "Europe/Istanbul" , 0x02ECC9 }, + { "Europe/Jersey" , 0x02F0B6 }, + { "Europe/Kaliningrad" , 0x02F5ED }, + { "Europe/Kiev" , 0x02F858 }, + { "Europe/Lisbon" , 0x02FB74 }, + { "Europe/Ljubljana" , 0x030078 }, + { "Europe/London" , 0x030341 }, + { "Europe/Luxembourg" , 0x030878 }, + { "Europe/Madrid" , 0x030CCE }, + { "Europe/Malta" , 0x031094 }, + { "Europe/Mariehamn" , 0x03144D }, + { "Europe/Minsk" , 0x031703 }, + { "Europe/Monaco" , 0x031916 }, + { "Europe/Moscow" , 0x031D51 }, + { "Europe/Nicosia" , 0x031FAB }, + { "Europe/Oslo" , 0x032293 }, + { "Europe/Paris" , 0x0325C5 }, + { "Europe/Podgorica" , 0x032A0B }, + { "Europe/Prague" , 0x032CD4 }, + { "Europe/Riga" , 0x033006 }, + { "Europe/Rome" , 0x03334B }, + { "Europe/Samara" , 0x03370E }, + { "Europe/San_Marino" , 0x033977 }, + { "Europe/Sarajevo" , 0x033D3A }, + { "Europe/Simferopol" , 0x034003 }, + { "Europe/Skopje" , 0x034254 }, + { "Europe/Sofia" , 0x03451D }, + { "Europe/Stockholm" , 0x034825 }, + { "Europe/Tallinn" , 0x034AD4 }, + { "Europe/Tirane" , 0x034E0E }, + { "Europe/Tiraspol" , 0x035114 }, + { "Europe/Uzhgorod" , 0x0354A2 }, + { "Europe/Vaduz" , 0x0357B9 }, + { "Europe/Vatican" , 0x035A68 }, + { "Europe/Vienna" , 0x035E2B }, + { "Europe/Vilnius" , 0x036158 }, + { "Europe/Volgograd" , 0x036497 }, + { "Europe/Warsaw" , 0x0366B8 }, + { "Europe/Zagreb" , 0x036A99 }, + { "Europe/Zaporozhye" , 0x036D62 }, + { "Europe/Zurich" , 0x0370A3 }, + { "Factory" , 0x037352 }, + { "GB" , 0x0373C3 }, + { "GB-Eire" , 0x0378FA }, + { "GMT" , 0x037E31 }, + { "GMT+0" , 0x037EFD }, + { "GMT-0" , 0x037EB9 }, + { "GMT0" , 0x037E75 }, + { "Greenwich" , 0x037F41 }, + { "Hongkong" , 0x037F85 }, + { "HST" , 0x038147 }, + { "Iceland" , 0x03818B }, + { "Indian/Antananarivo" , 0x038344 }, + { "Indian/Chagos" , 0x0383B8 }, + { "Indian/Christmas" , 0x03841A }, + { "Indian/Cocos" , 0x03845E }, + { "Indian/Comoro" , 0x0384A2 }, + { "Indian/Kerguelen" , 0x0384F7 }, + { "Indian/Mahe" , 0x03854C }, + { "Indian/Maldives" , 0x0385A1 }, + { "Indian/Mauritius" , 0x0385F6 }, + { "Indian/Mayotte" , 0x03866C }, + { "Indian/Reunion" , 0x0386C1 }, + { "Iran" , 0x038716 }, + { "Israel" , 0x038984 }, + { "Jamaica" , 0x038CB3 }, + { "Japan" , 0x038D78 }, + { "Kwajalein" , 0x038E02 }, + { "Libya" , 0x038E65 }, + { "MET" , 0x038F6E }, + { "Mexico/BajaNorte" , 0x039277 }, + { "Mexico/BajaSur" , 0x0395E0 }, + { "Mexico/General" , 0x039825 }, + { "MST" , 0x039A83 }, + { "MST7MDT" , 0x039AC7 }, + { "Navajo" , 0x039E18 }, + { "NZ" , 0x03A191 }, + { "NZ-CHAT" , 0x03A50F }, + { "Pacific/Apia" , 0x03A7F3 }, + { "Pacific/Auckland" , 0x03A98F }, + { "Pacific/Bougainville" , 0x03AD1B }, + { "Pacific/Chatham" , 0x03AD92 }, + { "Pacific/Chuuk" , 0x03B085 }, + { "Pacific/Easter" , 0x03B0DE }, + { "Pacific/Efate" , 0x03B42D }, + { "Pacific/Enderbury" , 0x03B4F3 }, + { "Pacific/Fakaofo" , 0x03B561 }, + { "Pacific/Fiji" , 0x03B5B2 }, + { "Pacific/Funafuti" , 0x03B745 }, + { "Pacific/Galapagos" , 0x03B789 }, + { "Pacific/Gambier" , 0x03B801 }, + { "Pacific/Guadalcanal" , 0x03B866 }, + { "Pacific/Guam" , 0x03B8BB }, + { "Pacific/Honolulu" , 0x03B911 }, + { "Pacific/Johnston" , 0x03B988 }, + { "Pacific/Kiritimati" , 0x03BA07 }, + { "Pacific/Kosrae" , 0x03BA72 }, + { "Pacific/Kwajalein" , 0x03BACF }, + { "Pacific/Majuro" , 0x03BB3B }, + { "Pacific/Marquesas" , 0x03BB9A }, + { "Pacific/Midway" , 0x03BC01 }, + { "Pacific/Nauru" , 0x03BC8B }, + { "Pacific/Niue" , 0x03BD03 }, + { "Pacific/Norfolk" , 0x03BD61 }, + { "Pacific/Noumea" , 0x03BDB6 }, + { "Pacific/Pago_Pago" , 0x03BE46 }, + { "Pacific/Palau" , 0x03BEBD }, + { "Pacific/Pitcairn" , 0x03BF01 }, + { "Pacific/Pohnpei" , 0x03BF56 }, + { "Pacific/Ponape" , 0x03BFAB }, + { "Pacific/Port_Moresby" , 0x03BFF0 }, + { "Pacific/Rarotonga" , 0x03C042 }, + { "Pacific/Saipan" , 0x03C11E }, + { "Pacific/Samoa" , 0x03C181 }, + { "Pacific/Tahiti" , 0x03C1F8 }, + { "Pacific/Tarawa" , 0x03C25D }, + { "Pacific/Tongatapu" , 0x03C2B1 }, + { "Pacific/Truk" , 0x03C33D }, + { "Pacific/Wake" , 0x03C382 }, + { "Pacific/Wallis" , 0x03C3D2 }, + { "Pacific/Yap" , 0x03C416 }, + { "Poland" , 0x03C45B }, + { "Portugal" , 0x03C83C }, + { "PRC" , 0x03CD38 }, + { "PST8PDT" , 0x03CDD8 }, + { "ROC" , 0x03D129 }, + { "ROK" , 0x03D25A }, + { "Singapore" , 0x03D321 }, + { "Turkey" , 0x03D3D8 }, + { "UCT" , 0x03D7C5 }, + { "Universal" , 0x03D809 }, + { "US/Alaska" , 0x03D84D }, + { "US/Aleutian" , 0x03DBB6 }, + { "US/Arizona" , 0x03DF1C }, + { "US/Central" , 0x03DFAA }, + { "US/East-Indiana" , 0x03E9B4 }, + { "US/Eastern" , 0x03E4B5 }, + { "US/Hawaii" , 0x03EC1E }, + { "US/Indiana-Starke" , 0x03EC8F }, + { "US/Michigan" , 0x03F000 }, + { "US/Mountain" , 0x03F337 }, + { "US/Pacific" , 0x03F6B0 }, + { "US/Pacific-New" , 0x03FAB5 }, + { "US/Samoa" , 0x03FEBA }, + { "UTC" , 0x03FF31 }, + { "W-SU" , 0x040228 }, + { "WET" , 0x03FF75 }, + { "Zulu" , 0x04046B }, }; /* 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[263343] = { /* Africa/Abidjan */ @@ -8304,13 +8305,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 +9050,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, @@ -9142,13 +9144,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, @@ -9584,13 +9589,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 +14394,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 +14411,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, @@ -16966,6 +16970,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 +17132,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 +17352,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, @@ -18532,4 +18547,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.9", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; -- cgit v1.2.1 From c8e1fae17f215a71ffddf834ef8ca409dfd8e50b Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Sun, 26 Oct 2014 16:59:17 -0700 Subject: Fix off-by-one here --- ext/opcache/zend_accelerator_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') 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); -- cgit v1.2.1 From 3c925b18fa96043e5d7e86f9ce544b143c3c2079 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 27 Oct 2014 07:45:34 +0100 Subject: Fix bug #63595 GMP memory management conflicts with other libraries using GMP Drop use of php memory allocators as this raise various conflicts with other extensions and libraries which use libgmp. No other solution found. We cannot for ensure correct use of allocator with shared lib. Some memory can allocated before php init Some memory can be freed after php shutdown Known broken run cases - php + curl + gnutls + gmp - mod_gnutls + mod_php + gnutls + gmp - php + freetds + gnutls + gmp - php + odbc + freetds + gnutls + gmp - php + php-mapi (zarafa) + gnutls + gmp --- ext/gmp/gmp.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'ext') diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index f51bd8c59c..b1553fa16f 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -324,30 +324,6 @@ static void _php_gmpnum_free(zend_rsrc_list_entry *rsrc TSRMLS_DC); # define MAX_BASE 36 #endif -/* {{{ 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); -} -/* }}} */ - /* {{{ ZEND_GINIT_FUNCTION */ static ZEND_GINIT_FUNCTION(gmp) @@ -369,8 +345,6 @@ ZEND_MODULE_STARTUP_D(gmp) #endif REGISTER_STRING_CONSTANT("GMP_VERSION", (char *)gmp_version, CONST_CS | CONST_PERSISTENT); - mp_set_memory_functions(gmp_emalloc, gmp_erealloc, gmp_efree); - return SUCCESS; } /* }}} */ -- cgit v1.2.1 From 11b119d526229672b3574036beb07effacfa8815 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 27 Oct 2014 13:08:21 +0100 Subject: fix datatype mismatches --- ext/standard/url_scanner_ex.c | 19 +++++++++++-------- ext/standard/url_scanner_ex.h | 2 +- ext/standard/url_scanner_ex.re | 19 +++++++++++-------- 3 files changed, 23 insertions(+), 17 deletions(-) (limited to 'ext') 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; -- cgit v1.2.1 From 13a218d3285f78812bb8a1d2214b9d6e166924b8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 28 Oct 2014 08:48:22 +0100 Subject: Ensure we have enough input data before parsing date This check have be removed in http://git.php.net/?p=php-src.git;a=commit;h=ba2f87b50667f147c198abd31fc31eb09522f3d7 But the parser really need 17 char. And the string need to be nul terminated for this check So avoid reading random byte from memory. --- ext/xmlrpc/libxmlrpc/xmlrpc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c index b766a5495a..f184cf49ee 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; -- cgit v1.2.1 From e6fe3127d0e02a58456fef1af969a8f114f85c31 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 28 Oct 2014 17:36:03 +0800 Subject: Fixed bug #68252 (segfault in Zend/zend_hash.c in function _zend_hash_del_el) Don't leave a UNDEF gap in function_table --- ext/opcache/tests/bug68252.phpt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ext/opcache/tests/bug68252.phpt (limited to 'ext') 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-- + +--FILE-- + Date: Mon, 27 Oct 2014 19:36:29 +0100 Subject: fix datatype mismatches --- ext/standard/user_filters.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') 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))) { -- cgit v1.2.1 From 41a505fc7f5546cfbabeb285404026fa31c0682f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 28 Oct 2014 10:43:58 +0100 Subject: fix datatype mismatches --- ext/com_dotnet/com_com.c | 18 +++++++++--------- ext/com_dotnet/com_handlers.c | 4 ++-- ext/com_dotnet/com_olechar.c | 2 +- ext/com_dotnet/com_persist.c | 10 +++++----- ext/com_dotnet/com_saproxy.c | 10 +++++----- ext/com_dotnet/com_typeinfo.c | 4 ++-- ext/com_dotnet/com_variant.c | 17 +++++++++++------ ext/com_dotnet/com_wrapper.c | 4 ++-- ext/com_dotnet/php_com_dotnet_internal.h | 5 +++-- 9 files changed, 40 insertions(+), 34 deletions(-) (limited to 'ext') diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 5f0b8ff697..ec276ee004 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -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; @@ -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; } @@ -631,7 +631,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; @@ -791,7 +791,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_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_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..17b69d2460 100644 --- a/ext/com_dotnet/com_typeinfo.c +++ b/ext/com_dotnet/com_typeinfo.c @@ -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 = (DWORD)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..2b91d28daf 100644 --- a/ext/com_dotnet/com_variant.c +++ b/ext/com_dotnet/com_variant.c @@ -62,7 +62,7 @@ static void safe_array_from_zval(VARIANT *v, zval *z, int codepage TSRMLS_DC) /* allocate the structure */ bound.lLbound = 0; - bound.cElements = intindex + 1; + bound.cElements = (ULONG)(intindex + 1); sa = SafeArrayCreate(VT_VARIANT, 1, &bound); /* get a lock on the array itself */ @@ -146,8 +146,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 +164,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; @@ -428,7 +433,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 +854,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 +914,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); -- cgit v1.2.1 From 1493124e2bfac9bc587d87385b094baf808a31a6 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 28 Oct 2014 16:09:17 +0100 Subject: initialize the input arg lengths --- ext/com_dotnet/com_com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index ec276ee004..12fcb62c40 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; -- cgit v1.2.1 From 3b6a9a3916bbf539e2114fefe4a1ea1fe9fba3fb Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 28 Oct 2014 16:10:27 +0100 Subject: exclude the 32 bit only test --- ext/com_dotnet/tests/bug33386.phpt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext') 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-- +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-- Date: Tue, 28 Oct 2014 16:37:04 +0100 Subject: several fixes to com_dotnet for x64 --- ext/com_dotnet/com_extension.c | 4 + ext/com_dotnet/com_variant.c | 28 +- ext/com_dotnet/tests/variants.phpt | 3 +- ext/com_dotnet/tests/variants_x64.phpt | 638 +++++++++++++++++++++++++++++++++ 4 files changed, 670 insertions(+), 3 deletions(-) create mode 100644 ext/com_dotnet/tests/variants_x64.phpt (limited to 'ext') diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index f66119842e..7e15865950 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -454,6 +454,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_variant.c b/ext/com_dotnet/com_variant.c index 2b91d28daf..6a81eed102 100644 --- a/ext/com_dotnet/com_variant.c +++ b/ext/com_dotnet/com_variant.c @@ -204,11 +204,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; @@ -333,7 +341,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); 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-- +if (!extension_loaded("com_dotnet")) print "skip COM/.Net support not present"; +if (4 != PHP_INT_SIZE) print "skip x86 only"; ?> --FILE-- +--FILE-- + 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! -- cgit v1.2.1 From e2951a191ef1afea777b865b9c80ac939b603f6b Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 28 Oct 2014 16:52:49 +0100 Subject: fix error code upcast on x64 --- ext/com_dotnet/com_misc.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext') 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); } -- cgit v1.2.1 From 05fa1b8ecc025335cef3bd3e22ba94bf9d0632fa Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 28 Oct 2014 17:06:37 +0100 Subject: fix possible zero deref --- ext/com_dotnet/com_com.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 12fcb62c40..6328a6b090 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -475,7 +475,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function * /* assumption: that the active function (f) is the function we generated for the engine */ if (!f || f->arg_info == NULL) { - f = NULL; + return FAILURE; } hr = php_com_get_id_of_name(obj, f->function_name->val, f->function_name->len, &dispid TSRMLS_CC); -- cgit v1.2.1 From efe9cc3a86a769f1ac3d16f4b12f5e83053c6822 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 28 Oct 2014 17:23:40 +0100 Subject: rework fix to php_com_do_invoke_byref, fix crashing function with void arguments --- ext/com_dotnet/com_com.c | 52 +++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 23 deletions(-) (limited to 'ext') diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index 6328a6b090..e1a9503dff 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -474,7 +474,7 @@ 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) { + if (!f) { return FAILURE; } @@ -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); } -- cgit v1.2.1 From daf9357d272c810718aceae57e6e77cdc62e1be8 Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Wed, 29 Oct 2014 11:26:22 +0100 Subject: Fixed test to work with recent libcurl versions --- ext/standard/tests/file/bug52820.phpt | 134 ++++++++++++++++------------------ 1 file changed, 63 insertions(+), 71 deletions(-) (limited to 'ext') 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-- - Date: Tue, 28 Oct 2014 19:50:06 +0100 Subject: fix datatype mismatch warnings --- ext/spl/php_spl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext') 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); -- cgit v1.2.1 From c6116bea572059baa643f38e491704ec2cb7e030 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 28 Oct 2014 19:59:31 +0100 Subject: fix datatype mismatches --- ext/spl/spl_directory.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'ext') 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() -- cgit v1.2.1 From 8041bbb76bb07274cb96bc6b8b8e0cee42648edc Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 28 Oct 2014 20:11:53 +0100 Subject: fix datatype mismatch warning --- ext/spl/spl_dllist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') 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 */ -- cgit v1.2.1 From e888f3e4de511faf65924eba7ac92bb9d02f32b5 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 28 Oct 2014 20:12:20 +0100 Subject: fix datatype mismatches --- ext/spl/spl_fixedarray.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext') 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])) { -- cgit v1.2.1 From 3a6db1e77a166914f4693bab274d1dbfecb5231b Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 29 Oct 2014 11:39:54 +0100 Subject: fix datatype mismatch --- ext/spl/spl_heap.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'ext') diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index d29150c1d6..b9f404ab11 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 : -1; } } 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 : -1; } } 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 : -1; } } compare_function(&result, a_priority_p, b_priority_p TSRMLS_CC); - return Z_LVAL(result); + return (int)Z_LVAL(result); } /* }}} */ -- cgit v1.2.1 From da1d0ee1bd8718cc5c10a010f1980bec7083d3fc Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 29 Oct 2014 11:48:29 +0100 Subject: fix the comparison return value --- ext/spl/spl_heap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c index b9f404ab11..b421c03757 100644 --- a/ext/spl/spl_heap.c +++ b/ext/spl/spl_heap.c @@ -160,7 +160,7 @@ static int spl_ptr_heap_zval_max_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* exception or call failure */ return 0; } - return lval > 0 ? 1 : -1; + return lval > 0 ? 1 : (lval < 0 ? -1 : 0); } } @@ -184,7 +184,7 @@ static int spl_ptr_heap_zval_min_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { /* exception or call failure */ return 0; } - return lval > 0 ? 1 : -1; + return lval > 0 ? 1 : (lval < 0 ? -1 : 0); } } @@ -215,7 +215,7 @@ static int spl_ptr_pqueue_zval_cmp(zval *a, zval *b, zval *object TSRMLS_DC) { / /* exception or call failure */ return 0; } - return lval > 0 ? 1 : -1; + return lval > 0 ? 1 : (lval < 0 ? -1 : 0); } } -- cgit v1.2.1 From 9d21ff6b9e6fbc16807640c1e7e471cebaff21c4 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 29 Oct 2014 13:36:10 +0100 Subject: fix datatype mismatches PCRE uses plain datatypes, no typedefs. --- ext/pcre/php_pcre.c | 60 ++++++++++++++++++++++++++--------------------------- ext/pcre/php_pcre.h | 10 ++++----- 2 files changed, 35 insertions(+), 35 deletions(-) (limited to 'ext') diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 67857da2c7..918214edb1 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; @@ -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 cd6621372f..a8523cff9c 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 -- cgit v1.2.1 From 110cf649b7d156f97f98cc8e894fb2d4ed8c67ff Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 29 Oct 2014 13:46:58 +0100 Subject: fix datatype mismatches especially spl_dual_it_object current.pos should have the same datatype as limit.offset, also this doesn't increase the struct size. --- ext/spl/spl_iterators.c | 15 +++++++++------ ext/spl/spl_iterators.h | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'ext') 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 { -- cgit v1.2.1 From 1100f1b8fdffe5ba16d6785b2ba2fc91c33f4833 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 29 Oct 2014 14:09:30 +0100 Subject: fix datatype mismatch --- ext/spl/spl_observer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') 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); } /* }}} */ -- cgit v1.2.1 From 897695764cb88b044679562a908f2df0df52b1f0 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 29 Oct 2014 14:28:16 +0100 Subject: fix datatype mismatches sizeof(struct _string) doesn't increase. --- ext/reflection/php_reflection.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'ext') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index cc4ed54dea..3d44c35b62 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) { @@ -3707,10 +3707,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 +3819,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 +5407,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: -- cgit v1.2.1 From 23f089a6b3586d524e8709d75262029bc8fa7ad4 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 29 Oct 2014 14:33:50 +0100 Subject: fix datatype mismatches --- ext/iconv/iconv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ext') diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index d425f6cf1e..a4581e9fad 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -408,7 +408,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; @@ -423,7 +423,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); } @@ -2300,7 +2300,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) { @@ -2353,7 +2353,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; } -- cgit v1.2.1 From fdbfcc0b51b5d78777625d5be93a282e23cc0540 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 29 Oct 2014 19:32:52 +0100 Subject: dll export APIs needed by phpdbg --- ext/standard/basic_functions.c | 4 ++-- ext/standard/basic_functions.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index ca14b28ccd..c5392760e8 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -5051,7 +5051,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 { @@ -5063,7 +5063,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 3af85b3d40..eaeb9bca83 100644 --- a/ext/standard/basic_functions.h +++ b/ext/standard/basic_functions.h @@ -261,4 +261,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 */ -- cgit v1.2.1 From 88d2e43db3d372b6f0c7dea142d53be36af8622d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 30 Oct 2014 14:36:57 +0100 Subject: fix datatype mismatch warnings --- ext/bcmath/bcmath.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'ext') diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 7ef30cad5e..5c4e8740e4 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -209,14 +209,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); @@ -246,14 +246,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); @@ -283,14 +283,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); @@ -320,14 +320,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); @@ -411,11 +411,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 { @@ -438,14 +438,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); @@ -475,14 +475,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); @@ -510,14 +510,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); -- cgit v1.2.1 From 05bad6a95778ae0d2de5273b441b87bde2ed0dea Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 30 Oct 2014 17:18:10 +0100 Subject: fix some datatype mismatches in ext/bz2 Additionally, as bz2 read/write routines expect int for sizes, it could overflow. So fixed the logic. Things in compress/decompress are more complicated so they was left as they are yet. --- ext/bz2/bz2.c | 44 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 9 deletions(-) (limited to 'ext') 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; } -- cgit v1.2.1 From edfabf19a756bd8023698087d822e420824edfe4 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 30 Oct 2014 17:25:17 +0100 Subject: fix datatype mismatch warnings --- ext/bz2/bz2_filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') 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); } } } -- cgit v1.2.1 From c7fa02948792a302c70e7530ee1058d6d3abefe6 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 30 Oct 2014 18:07:58 +0100 Subject: fix datatype mismatch warnings --- ext/ctype/ctype.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') 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); \ -- cgit v1.2.1 From b0499545ee863c5173c82fe5e3e9b5289db13bf0 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 30 Oct 2014 18:37:56 +0100 Subject: fix datatype mismatches --- ext/date/lib/parse_date.c | 6 +++--- ext/date/lib/parse_date.re | 4 ++-- ext/date/lib/parse_iso_intervals.c | 4 ++-- ext/date/lib/parse_iso_intervals.re | 2 +- ext/date/lib/timelib.h | 6 +++--- ext/date/php_date.c | 10 +++++----- ext/date/php_date.h | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) (limited to 'ext') 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/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 aa46aa1b6c..ebbf9a9027 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); -- cgit v1.2.1 From f6f81b6545bbb1a6c100aa5e074eda0402867d2f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 30 Oct 2014 20:04:14 +0100 Subject: fix datatype mismatche warnings --- ext/filter/logical_filters.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'ext') 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; -- cgit v1.2.1 From e0ee1fbc2699edd6ea731f1ec1a500c33a76242c Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 30 Oct 2014 20:06:12 +0100 Subject: fix datatype mismatches --- ext/filter/sanitizing_filters.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') 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) { -- cgit v1.2.1 From 1551db8faa3c599a123b6d51cdf3063e949af737 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 30 Oct 2014 15:15:51 -0700 Subject: Added constant expression evaluation for "dirname(__FILE__)". Improved constant expression evaluation for function calls --- ext/opcache/Optimizer/pass1_5.c | 189 ++++++++++++++++++++++++++-------------- 1 file changed, 123 insertions(+), 66 deletions(-) (limited to 'ext') diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index b91ac5b50f..180482f6ee 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -341,28 +341,57 @@ 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) { + 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) { + + zend_optimizer_collect_constant(ctx, &ZEND_OP1_LITERAL(send1_opline), &ZEND_OP1_LITERAL(send2_opline)); break; } - } else { - /* don't colllect constants after any other function call */ - collect_constants = 0; } /* pre-evaluate constant functions: @@ -372,42 +401,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 +453,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 +588,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; -- cgit v1.2.1 From 10107db61ec1ac695bb7167cae49d0e1b7271b11 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 30 Oct 2014 16:42:39 -0700 Subject: Use DECLARE_CONST instruction instead of call to internal define() function when possible --- ext/opcache/Optimizer/pass1_5.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 180482f6ee..15bca2adf8 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -381,15 +381,33 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx TSRML } /* define("name", scalar); */ - if (collect_constants && - Z_STRLEN(ZEND_OP2_LITERAL(init_opline)) == sizeof("define")-1 && + 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 (Z_TYPE(ZEND_OP1_LITERAL(send1_opline)) == IS_STRING && send2_opline && Z_TYPE(ZEND_OP1_LITERAL(send2_opline)) <= IS_STRING) { - zend_optimizer_collect_constant(ctx, &ZEND_OP1_LITERAL(send1_opline), &ZEND_OP1_LITERAL(send2_opline)); + 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; } } -- cgit v1.2.1 From d9d181e5ad41128a97a6e01d14fb766ff7bf31a8 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 31 Oct 2014 17:32:23 +0800 Subject: Fixed Bug #68104 (Segfault while pre-evaluating a disabled function) --- ext/opcache/tests/bug68104.phpt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ext/opcache/tests/bug68104.phpt (limited to 'ext') diff --git a/ext/opcache/tests/bug68104.phpt b/ext/opcache/tests/bug68104.phpt new file mode 100644 index 0000000000..521486ef58 --- /dev/null +++ b/ext/opcache/tests/bug68104.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #68104 (Segfault while pre-evaluating a disabled function) +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +disable_functions=dl +--SKIPIF-- + +--FILE-- + Date: Fri, 31 Oct 2014 18:10:01 +0100 Subject: Fixed bug #67462 PDO_PGSQL::beginTransaction() wrongly throws exception when not in transaction --- ext/pdo_pgsql/pgsql_driver.c | 28 ++++++++++++++++++---------- ext/pdo_pgsql/tests/bug67462.phpt | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 10 deletions(-) create mode 100644 ext/pdo_pgsql/tests/bug67462.phpt (limited to 'ext') diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 3be9359216..9638c72fe6 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -465,6 +465,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; @@ -489,7 +498,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); + } + + return ret; } static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS_DC) @@ -497,15 +514,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/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-- + +--FILE-- +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) -- cgit v1.2.1 From 29ee69434122bcda8c904ff6fbde2b9c74332240 Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Fri, 31 Oct 2014 18:54:16 +0100 Subject: Added PGSQL_TEST_CONNSTR env var support for ext/pgsql tests --- ext/pgsql/tests/config.inc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/pgsql/tests/config.inc b/ext/pgsql/tests/config.inc index d4bbb33824..224d055087 100644 --- a/ext/pgsql/tests/config.inc +++ b/ext/pgsql/tests/config.inc @@ -1,12 +1,15 @@ \ No newline at end of file +?> -- cgit v1.2.1 From e3934515c4535975df573ff3588b7e8ecbd86715 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 31 Oct 2014 18:35:55 +0100 Subject: fix datatype mismatch warnings --- ext/mcrypt/mcrypt.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'ext') 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); } -- cgit v1.2.1 From a6ebaa142e9f2d184b5a64653ce9f2d19092b56f Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 31 Oct 2014 18:41:41 +0100 Subject: fix datatype mismatch warnings --- ext/mcrypt/mcrypt_filter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ext') 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; -- cgit v1.2.1 From 6498126afa33870b7434225131e91da989d9ce9d Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 31 Oct 2014 19:11:34 +0100 Subject: fix datatype mismatches --- ext/pgsql/pgsql.c | 56 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 27 deletions(-) (limited to 'ext') diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 207764b165..0bc6fd263d 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 @@ -1272,7 +1273,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); @@ -1307,7 +1309,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]); @@ -1560,7 +1562,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); } @@ -1607,7 +1609,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); } @@ -1830,7 +1832,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) { @@ -1933,7 +1935,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) { @@ -2049,7 +2051,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) { @@ -2136,7 +2138,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) { @@ -2898,7 +2900,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; } @@ -2938,7 +2940,7 @@ PHP_FUNCTION(pg_result_seek) } /* seek to offset */ - pg_result->row = row; + pg_result->row = (int)row; RETURN_TRUE; } /* }}} */ @@ -3092,7 +3094,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; @@ -3137,7 +3139,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); } @@ -3170,7 +3172,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; @@ -3263,7 +3265,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, @@ -3273,7 +3275,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 { @@ -3335,7 +3337,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, @@ -3345,7 +3347,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 { @@ -3490,7 +3492,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; } @@ -3557,7 +3559,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 */ @@ -3666,7 +3668,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, @@ -3677,7 +3679,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, @@ -3833,7 +3835,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) { @@ -3871,7 +3873,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) { @@ -3902,7 +3904,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); } @@ -3937,7 +3939,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); } @@ -3972,7 +3974,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) { @@ -4598,7 +4600,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 { -- cgit v1.2.1 From ed9ada5fa124cbdc0fa7d7845ef61b4eb7c31798 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 31 Oct 2014 19:35:51 +0100 Subject: fix datatype mismatches --- ext/pgsql/pgsql.c | 77 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 34 deletions(-) (limited to 'ext') diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 0bc6fd263d..4b1cc31cc8 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -1756,7 +1756,7 @@ PHP_FUNCTION(pg_parameter_status) id = -1; } else if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", ¶m, &len) == SUCCESS) { pgsql_link = NULL; - id = PGG(default_link)? PGG(default_link)->handle : -1; + id = FETCH_DEFAULT_LINK(); } else { RETURN_FALSE; } @@ -1789,7 +1789,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; @@ -2416,7 +2416,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; @@ -2511,20 +2511,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}; @@ -2629,26 +2629,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(); @@ -2714,13 +2718,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; @@ -2912,10 +2916,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)); } } } @@ -2980,28 +2984,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: @@ -3449,7 +3457,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; @@ -3460,7 +3469,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); @@ -3743,9 +3752,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); @@ -4194,7 +4203,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; @@ -4272,7 +4281,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: @@ -4317,7 +4326,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: @@ -4490,7 +4499,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: -- cgit v1.2.1 From 1fc80d0ca7f4fbf826d11dbcaa1b3cd79e8351a0 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 31 Oct 2014 19:53:16 +0100 Subject: fix ZTS build --- ext/pdo_pgsql/pgsql_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 9638c72fe6..17757a7b2d 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -503,7 +503,7 @@ static int pgsql_handle_commit(pdo_dbh_t *dbh TSRMLS_DC) /* 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); + dbh->in_txn = pgsql_handle_in_transaction(dbh TSRMLS_CC); } return ret; -- cgit v1.2.1 From 00b50850ebcb2ecc4bd4be053f31556567efa28d Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Sat, 1 Nov 2014 22:29:55 +0800 Subject: Add credit --- ext/opcache/tests/bug68104.phpt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ext') diff --git a/ext/opcache/tests/bug68104.phpt b/ext/opcache/tests/bug68104.phpt index 89439ef68e..8d3bf70a4d 100644 --- a/ext/opcache/tests/bug68104.phpt +++ b/ext/opcache/tests/bug68104.phpt @@ -1,5 +1,7 @@ --TEST-- Bug #68104 (Segfault while pre-evaluating a disabled function) +--CREDITS-- +manuel --INI-- opcache.enable=1 opcache.enable_cli=1 -- cgit v1.2.1 From 69f6aee35c5da6983a1bb5bb00ecf0ab776379d9 Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Sat, 1 Nov 2014 19:11:43 +0100 Subject: Fixed bug #66584 Segmentation fault on statement deallocation --- ext/pdo_pgsql/pgsql_statement.c | 2 +- ext/pdo_pgsql/tests/bug66584.phpt | 66 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 ext/pdo_pgsql/tests/bug66584.phpt (limited to 'ext') diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index ea5a67633e..1fa7ce4777 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -294,7 +294,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * sizeof(Oid)); } if (param->paramno >= 0) { - 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; } 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-- + +--FILE-- +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" -- cgit v1.2.1 From c351b47ce85a3a147cfa801fa9f0149ab4160834 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Sun, 2 Nov 2014 16:04:00 -0800 Subject: Initialize the offset table - PCRE may sometimes miss offsets --- ext/pcre/php_pcre.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index bd93f723d6..d7a4309b24 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -640,7 +640,7 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subjec } 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); -- cgit v1.2.1 From 342d56b23d05dcafa5019efc401a78592d823b49 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 4 Nov 2014 16:58:32 +0100 Subject: arg1-3 are not variable names to use; removed useless buffer variable --- ext/standard/file.c | 114 +++++++++++++++++++++++++--------------------------- 1 file changed, 55 insertions(+), 59 deletions(-) (limited to 'ext') diff --git a/ext/standard/file.c b/ext/standard/file.c index 10ed693f01..a2b4db154a 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; 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 && PZVAL_IS_REF(arg3)) { - convert_to_long_ex(&arg3); - Z_LVAL_P(arg3) = 0; + if (wouldblock && PZVAL_IS_REF(wouldblock)) { + convert_to_long_ex(&wouldblock); + Z_LVAL_P(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 && PZVAL_IS_REF(arg3)) { - Z_LVAL_P(arg3) = 1; + if (operation && errno == EWOULDBLOCK && wouldblock && PZVAL_IS_REF(wouldblock)) { + Z_LVAL_P(wouldblock) = 1; } RETURN_FALSE; } @@ -896,14 +896,14 @@ PHP_NAMED_FUNCTION(php_if_fopen) Close an open file pointer */ PHPAPI PHP_FUNCTION(fclose) { - 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 ((stream->flags & PHP_STREAM_FLAG_NO_FCLOSE) != 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a valid stream resource", stream->rsrc_id); @@ -968,14 +968,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_delete(stream->rsrc_id); @@ -988,14 +988,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; @@ -1009,18 +1009,18 @@ PHPAPI PHP_FUNCTION(feof) Get a line from file pointer */ PHPAPI PHP_FUNCTION(fgets) { - zval *arg1; + zval *res; 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 */ @@ -1060,16 +1060,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); @@ -1180,35 +1180,31 @@ PHP_FUNCTION(fscanf) Binary-safe file write */ PHPAPI PHP_FUNCTION(fwrite) { - zval *arg1; - char *arg2; - int arg2len; + zval *res; + char *input; + int inputlen; int ret; int num_bytes; - long arg3 = 0; - char *buffer = NULL; + 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 { - num_bytes = MAX(0, MIN((int)arg3, arg2len)); + num_bytes = MAX(0, MIN((int) 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); } @@ -1218,15 +1214,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) { @@ -1240,14 +1236,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; @@ -1260,15 +1256,15 @@ PHPAPI PHP_FUNCTION(rewind) Get file pointer's read/write position */ PHPAPI PHP_FUNCTION(ftell) { - zval *arg1; + zval *res; 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) { @@ -1282,17 +1278,17 @@ PHPAPI PHP_FUNCTION(ftell) Seek on a file pointer */ PHPAPI PHP_FUNCTION(fseek) { - zval *arg1; - long arg2, whence = SEEK_SET; + zval *res; + 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, whence)); + RETURN_LONG(php_stream_seek(stream, offset, whence)); } /* }}} */ @@ -1394,7 +1390,7 @@ PHP_FUNCTION(readfile) Return or change the umask */ PHP_FUNCTION(umask) { - long arg1 = 0; + long mask = 0; int oldumask; oldumask = umask(077); @@ -1403,14 +1399,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(arg1); + umask(mask); } RETURN_LONG(oldumask); @@ -1421,15 +1417,15 @@ PHP_FUNCTION(umask) Output all remaining data from a file pointer */ PHPAPI PHP_FUNCTION(fpassthru) { - zval *arg1; + zval *res; int 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); @@ -1751,15 +1747,15 @@ safe_to_copy: Binary-safe file read */ PHPAPI PHP_FUNCTION(fread) { - zval *arg1; + zval *res; 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"); -- cgit v1.2.1 From 90b4ec51adad6791b508d65b81e45233d687c23f Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 4 Nov 2014 18:23:20 +0100 Subject: Fix bad merge --- ext/standard/file.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/standard/file.c b/ext/standard/file.c index 97ffe69453..4804e49338 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -344,7 +344,7 @@ PHP_FUNCTION(flock) php_stream *stream; zend_long operation = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z", &res, &operation, &wouldblock) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|z/", &res, &operation, &wouldblock) == FAILURE) { return; } @@ -1207,8 +1207,10 @@ PHPAPI PHP_FUNCTION(fwrite) if (ZEND_NUM_ARGS() == 2) { num_bytes = inputlen; + } else if (maxlen <= 0) { + num_bytes = 0; } else { - num_bytes = MAX(0, MIN((size_t) maxlen, inputlen)); + num_bytes = MIN((size_t) maxlen, inputlen); } if (!num_bytes) { -- cgit v1.2.1 From 53266476e63608e4ce03c6d584864755806b28fe Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 5 Nov 2014 15:42:45 +0100 Subject: fix dir separator in test --- ext/curl/tests/bug68089.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') 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 -- cgit v1.2.1 From 4dd3fbfcd28f8a3826361c5c4b7aa4c4da592b22 Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Thu, 6 Nov 2014 13:06:29 +0900 Subject: Fixed bug #68331 - This was partial patch for https://wiki.php.net/rfc/session-lock-ini --- ext/session/session.c | 17 +---------------- .../session_set_save_handler_write_short_circuit.phpt | 1 + 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'ext') diff --git a/ext/session/session.c b/ext/session/session.c index d440e6fdd9..edc8f15d5b 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -514,17 +514,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, vallen); - PHP_MD5Final(PS(session_data_hash), &context); - php_session_decode(val, vallen TSRMLS_CC); str_efree(val); - } else { - memset(PS(session_data_hash),'\0', 16); } if (!PS(use_cookies) && PS(send_cookie)) { @@ -554,12 +545,7 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */ PHP_MD5Init(&context); PHP_MD5Update(&context, val, vallen); 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, vallen TSRMLS_CC); - } else { - ret = SUCCESS; - } + ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); efree(val); } else { ret = PS(mod)->s_write(&PS(mod_data), PS(id), "", 0 TSRMLS_CC); @@ -1994,7 +1980,6 @@ static PHP_FUNCTION(session_regenerate_id) RETURN_FALSE; } efree(PS(id)); - memset(PS(session_data_hash),'\0', 16); } PS(id) = PS(mod)->s_create_sid(&PS(mod_data), NULL TSRMLS_CC); 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-- +skip - Waiting RFC patch merge --FILE-- Date: Thu, 6 Nov 2014 14:50:03 +0300 Subject: Improved object property access. --- ext/reflection/php_reflection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 3d44c35b62..b972c2899c 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3363,7 +3363,7 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value 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]; + prop = &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)]; } } if (!prop) { -- cgit v1.2.1 From 8fdc4d8797e176f9bb8d9f9509a45346478d9cc1 Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Thu, 6 Nov 2014 15:46:49 +0100 Subject: Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving) --- ext/pdo_pgsql/pgsql_statement.c | 1 + ext/pdo_pgsql/tests/bug62593.phpt | 15 +++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'ext') diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 1fa7ce4777..4e183311e2 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -370,6 +370,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * ((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) { SEPARATE_ZVAL(¶m->parameter); param->param_type = PDO_PARAM_STR; + convert_to_boolean(param->parameter); ZVAL_STRINGL(param->parameter, Z_BVAL_P(param->parameter) ? "t" : "f", 1, 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 -- cgit v1.2.1 From 8fccf0bac9eab67412612b2df14da58b9129c6b2 Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Thu, 6 Nov 2014 15:46:49 +0100 Subject: Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving) --- ext/pdo_pgsql/pgsql_statement.c | 1 + ext/pdo_pgsql/tests/bug62593.phpt | 15 +++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'ext') diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 7da130d52b..2656586856 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -371,6 +371,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * ((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) { SEPARATE_ZVAL(¶m->parameter); param->param_type = PDO_PARAM_STR; + convert_to_boolean(param->parameter); ZVAL_STRINGL(param->parameter, Z_BVAL_P(param->parameter) ? "t" : "f", 1, 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 -- cgit v1.2.1 From f5130c3058133c6919673b5e0eb4f59a98921946 Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Thu, 6 Nov 2014 15:46:49 +0100 Subject: Fixed bug #68351 (PDO::PARAM_BOOL and ATTR_EMULATE_PREPARES misbehaving) --- ext/pdo_pgsql/pgsql_statement.c | 9 ++------- ext/pdo_pgsql/tests/bug62593.phpt | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'ext') diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index 9e8fc746fa..c274324b08 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -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 = ¶m->parameter; - } SEPARATE_ZVAL(¶m->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(¶m->parameter, Z_TYPE_P(¶m->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 -- cgit v1.2.1 From 45719aee26f250e59c7d917a8f913c2fce48b146 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 7 Nov 2014 09:55:13 +0300 Subject: fixed compilation error --- ext/pdo_pgsql/pgsql_statement.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index c274324b08..49fbc63745 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -378,7 +378,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * ((param->param_type & PDO_PARAM_INPUT_OUTPUT) != PDO_PARAM_INPUT_OUTPUT)) { SEPARATE_ZVAL(¶m->parameter); param->param_type = PDO_PARAM_STR; - convert_to_boolean(param->parameter); + convert_to_boolean(¶m->parameter); ZVAL_STRINGL(¶m->parameter, Z_TYPE_P(¶m->parameter) == IS_TRUE ? "t" : "f", 1); } } -- cgit v1.2.1 From 033abd6d7783a8c98e8fc3612aa100de72408363 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 7 Nov 2014 10:16:25 +0300 Subject: Fix opcache.revalidate_freq per-request behavior --- ext/opcache/ZendAccelerator.c | 17 +++-------------- ext/opcache/ZendAccelerator.h | 1 - 2 files changed, 3 insertions(+), 15 deletions(-) (limited to 'ext') diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 44064004f8..1d3bd959ff 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -881,12 +881,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; } } @@ -1449,7 +1449,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) { @@ -2155,13 +2155,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(); @@ -2622,10 +2615,6 @@ static int accel_startup(zend_extension *extension) zend_resolve_path = persistent_zend_resolve_path; #endif - if (ZCG(accel_directives).validate_timestamps) { - ZCSG(revalidate_at) = zend_accel_get_time() + ZCG(accel_directives).revalidate_freq; - } - /* Override chdir() function */ if (zend_hash_find(CG(function_table), "chdir", sizeof("chdir"), (void**)&func) == SUCCESS && func->type == ZEND_INTERNAL_FUNCTION) { diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index bba36316d9..547e315823 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -297,7 +297,6 @@ typedef struct _zend_accel_shared_globals { unsigned long restart_in; #endif zend_bool restart_in_progress; - time_t revalidate_at; #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO /* Interned Strings Support */ char *interned_strings_start; -- cgit v1.2.1 From b9f1daa97608294064e393ed0d15bcceb21d926e Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 6 Nov 2014 20:42:46 +0100 Subject: basic clang compatibility on windows --- ext/standard/basic_functions.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ext') diff --git a/ext/standard/basic_functions.h b/ext/standard/basic_functions.h index ee0e025c5d..5adc9a9a11 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 +#endif + extern zend_module_entry basic_functions_module; #define basic_functions_module_ptr &basic_functions_module -- cgit v1.2.1 From 7d7182e1b04544beb5de764e7a91be41848b2e15 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 7 Nov 2014 19:13:41 +0100 Subject: fix gd compilation with icc toolset --- ext/gd/config.w32 | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext') diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 index 2127fc5dce..b6f45a9c64 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 (INTEL_TOOLSET) { + ADD_FLAG("LDFLAGS_GD", "/nodefaultlib:libcmt"); + } PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd" ); } else { -- cgit v1.2.1 From af7e3064f35708fa9540ee1c18217811980f0865 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 7 Nov 2014 19:24:17 +0100 Subject: rename intel toolset to icc - shorter --- ext/gd/config.w32 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/gd/config.w32 b/ext/gd/config.w32 index b6f45a9c64..da6d0d2ff5 100644 --- a/ext/gd/config.w32 +++ b/ext/gd/config.w32 @@ -83,7 +83,7 @@ if (PHP_GD != "no") { /D USE_GD_IOCTX \ /D MSWIN32 \ "); - if (INTEL_TOOLSET) { + if (ICC_TOOLSET) { ADD_FLAG("LDFLAGS_GD", "/nodefaultlib:libcmt"); } -- cgit v1.2.1 From 1e5077d1e85cf150b0aedb72da68c8e335f39841 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Mon, 10 Nov 2014 10:41:18 -0800 Subject: Fix skipif test here --- ext/sockets/tests/mcast_ipv4_send.phpt | 131 +++++++++++++++++---------------- 1 file changed, 66 insertions(+), 65 deletions(-) (limited to 'ext') 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-- - Date: Mon, 10 Nov 2014 10:41:18 -0800 Subject: Fix skipif test here --- ext/sockets/tests/mcast_ipv4_send.phpt | 131 +++++++++++++++++---------------- 1 file changed, 66 insertions(+), 65 deletions(-) (limited to 'ext') 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-- - Date: Mon, 10 Nov 2014 10:41:18 -0800 Subject: Fix skipif test here --- ext/sockets/tests/mcast_ipv4_send.phpt | 131 +++++++++++++++++---------------- 1 file changed, 66 insertions(+), 65 deletions(-) (limited to 'ext') 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-- - Date: Tue, 11 Nov 2014 16:22:49 +0800 Subject: Fixed bug #68361 (Segmentation fault on SoapClient::__getTypes) --- ext/soap/soap.c | 3 ++ ext/soap/tests/bug68361.phpt | 114 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 ext/soap/tests/bug68361.phpt (limited to 'ext') diff --git a/ext/soap/soap.c b/ext/soap/soap.c index cca8c912e9..80a3a93cec 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -4746,6 +4746,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) zend_hash_find(type->attributes, SOAP_1_1_ENC_NAMESPACE":arrayType", sizeof(SOAP_1_1_ENC_NAMESPACE":arrayType"), (void **)&attr) == SUCCESS && + (*attr)->extraAttributes && zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":arrayType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) { char *end = strchr((*ext)->val, '['); int len; @@ -4770,6 +4771,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":itemType", sizeof(SOAP_1_2_ENC_NAMESPACE":itemType"), (void **)&attr) == SUCCESS && + (*attr)->extraAttributes && zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arrayType"), (void **)&ext) == SUCCESS) { smart_str_appends(buf, (*ext)->val); smart_str_appendc(buf, ' '); @@ -4789,6 +4791,7 @@ static void type_to_string(sdlTypePtr type, smart_str *buf, int level) zend_hash_find(type->attributes, SOAP_1_2_ENC_NAMESPACE":arraySize", sizeof(SOAP_1_2_ENC_NAMESPACE":arraySize"), (void **)&attr) == SUCCESS && + (*attr)->extraAttributes && zend_hash_find((*attr)->extraAttributes, WSDL_NAMESPACE":itemType", sizeof(WSDL_NAMESPACE":arraySize"), (void **)&ext) == SUCCESS) { 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-- + +--FILE-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +XML; + +file_put_contents(__DIR__ . "/bug68361.xml", $xml); +$client = new SoapClient(__DIR__ . "/bug68361.xml"); + +$res = $client->__getTypes(); // Segmentation fault here + +print_r($res); +?> +--CLEAN-- + +--EXPECT-- +Array +( + [0] => anyType ArrayOfEmployeeReturn[] + [1] => struct Employee { + int id; + string department; + string name; + int age; +} + [2] => struct User { + string name; + int age; +} +) -- cgit v1.2.1 From 695a102ede7301389c5224114407e91c93c46f90 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Tue, 11 Nov 2014 14:01:24 -0300 Subject: - Updated to version 2014.10 (2014j) --- ext/date/lib/timezonedb.h | 1356 +++++++++++++++++++++++---------------------- 1 file changed, 688 insertions(+), 668 deletions(-) (limited to 'ext') diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h index 0fd9bfbe10..157f0f4941 100644 --- a/ext/date/lib/timezonedb.h +++ b/ext/date/lib/timezonedb.h @@ -2,589 +2,589 @@ 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" , 0x01B912 }, - { "Asia/Hovd" , 0x01BAD4 }, - { "Asia/Irkutsk" , 0x01BC4C }, - { "Asia/Istanbul" , 0x01BE37 }, - { "Asia/Jakarta" , 0x01C224 }, - { "Asia/Jayapura" , 0x01C2CE }, - { "Asia/Jerusalem" , 0x01C36B }, - { "Asia/Kabul" , 0x01C69A }, - { "Asia/Kamchatka" , 0x01C6EB }, - { "Asia/Karachi" , 0x01C8E4 }, - { "Asia/Kashgar" , 0x01C999 }, - { "Asia/Kathmandu" , 0x01C9EE }, - { "Asia/Katmandu" , 0x01CA54 }, - { "Asia/Khandyga" , 0x01CABA }, - { "Asia/Kolkata" , 0x01CCE4 }, - { "Asia/Krasnoyarsk" , 0x01CD5D }, - { "Asia/Kuala_Lumpur" , 0x01CF4A }, - { "Asia/Kuching" , 0x01D007 }, - { "Asia/Kuwait" , 0x01D0F5 }, - { "Asia/Macao" , 0x01D14A }, - { "Asia/Macau" , 0x01D285 }, - { "Asia/Magadan" , 0x01D3C0 }, - { "Asia/Makassar" , 0x01D5C4 }, - { "Asia/Manila" , 0x01D689 }, - { "Asia/Muscat" , 0x01D70E }, - { "Asia/Nicosia" , 0x01D763 }, - { "Asia/Novokuznetsk" , 0x01DA4B }, - { "Asia/Novosibirsk" , 0x01DC6B }, - { "Asia/Omsk" , 0x01DE5B }, - { "Asia/Oral" , 0x01E047 }, - { "Asia/Phnom_Penh" , 0x01E217 }, - { "Asia/Pontianak" , 0x01E26C }, - { "Asia/Pyongyang" , 0x01E32E }, - { "Asia/Qatar" , 0x01E3BE }, - { "Asia/Qyzylorda" , 0x01E424 }, - { "Asia/Rangoon" , 0x01E5FA }, - { "Asia/Riyadh" , 0x01E672 }, - { "Asia/Saigon" , 0x01E6C7 }, - { "Asia/Sakhalin" , 0x01E769 }, - { "Asia/Samarkand" , 0x01E966 }, - { "Asia/Seoul" , 0x01EA9C }, - { "Asia/Shanghai" , 0x01EB63 }, - { "Asia/Singapore" , 0x01EC0F }, - { "Asia/Srednekolymsk" , 0x01ECC6 }, - { "Asia/Taipei" , 0x01EEC6 }, - { "Asia/Tashkent" , 0x01EFF7 }, - { "Asia/Tbilisi" , 0x01F128 }, - { "Asia/Tehran" , 0x01F2E2 }, - { "Asia/Tel_Aviv" , 0x01F550 }, - { "Asia/Thimbu" , 0x01F87F }, - { "Asia/Thimphu" , 0x01F8E5 }, - { "Asia/Tokyo" , 0x01F94B }, - { "Asia/Ujung_Pandang" , 0x01F9D5 }, - { "Asia/Ulaanbaatar" , 0x01FA52 }, - { "Asia/Ulan_Bator" , 0x01FBAD }, - { "Asia/Urumqi" , 0x01FCFA }, - { "Asia/Ust-Nera" , 0x01FD5C }, - { "Asia/Vientiane" , 0x01FF6E }, - { "Asia/Vladivostok" , 0x01FFC3 }, - { "Asia/Yakutsk" , 0x0201AD }, - { "Asia/Yekaterinburg" , 0x020397 }, - { "Asia/Yerevan" , 0x0205B8 }, - { "Atlantic/Azores" , 0x0207B8 }, - { "Atlantic/Bermuda" , 0x020CBB }, - { "Atlantic/Canary" , 0x020F9C }, - { "Atlantic/Cape_Verde" , 0x021272 }, - { "Atlantic/Faeroe" , 0x0212EB }, - { "Atlantic/Faroe" , 0x02158F }, - { "Atlantic/Jan_Mayen" , 0x021833 }, - { "Atlantic/Madeira" , 0x021B65 }, - { "Atlantic/Reykjavik" , 0x02206E }, - { "Atlantic/South_Georgia" , 0x022227 }, - { "Atlantic/St_Helena" , 0x022439 }, - { "Atlantic/Stanley" , 0x02226B }, - { "Australia/ACT" , 0x02248E }, - { "Australia/Adelaide" , 0x0227B1 }, - { "Australia/Brisbane" , 0x022AE3 }, - { "Australia/Broken_Hill" , 0x022BB0 }, - { "Australia/Canberra" , 0x022EF4 }, - { "Australia/Currie" , 0x023217 }, - { "Australia/Darwin" , 0x023550 }, - { "Australia/Eucla" , 0x0235DC }, - { "Australia/Hobart" , 0x0236B8 }, - { "Australia/LHI" , 0x023A1C }, - { "Australia/Lindeman" , 0x023CBD }, - { "Australia/Lord_Howe" , 0x023DA4 }, - { "Australia/Melbourne" , 0x024055 }, - { "Australia/North" , 0x024380 }, - { "Australia/NSW" , 0x0243FA }, - { "Australia/Perth" , 0x02471D }, - { "Australia/Queensland" , 0x0247FB }, - { "Australia/South" , 0x0248AD }, - { "Australia/Sydney" , 0x024BD0 }, - { "Australia/Tasmania" , 0x024F13 }, - { "Australia/Victoria" , 0x02525E }, - { "Australia/West" , 0x025581 }, - { "Australia/Yancowinna" , 0x02563D }, - { "Brazil/Acre" , 0x025965 }, - { "Brazil/DeNoronha" , 0x025A69 }, - { "Brazil/East" , 0x025B89 }, - { "Brazil/West" , 0x025E66 }, - { "Canada/Atlantic" , 0x025F5E }, - { "Canada/Central" , 0x026446 }, - { "Canada/East-Saskatchewan" , 0x026D50 }, - { "Canada/Eastern" , 0x026860 }, - { "Canada/Mountain" , 0x026ED9 }, - { "Canada/Newfoundland" , 0x02724F }, - { "Canada/Pacific" , 0x02777A }, - { "Canada/Saskatchewan" , 0x027B93 }, - { "Canada/Yukon" , 0x027D1C }, - { "CET" , 0x02801F }, - { "Chile/Continental" , 0x028328 }, - { "Chile/EasterIsland" , 0x0286C3 }, - { "CST6CDT" , 0x028A05 }, - { "Cuba" , 0x028D56 }, - { "EET" , 0x0290C9 }, - { "Egypt" , 0x02937C }, - { "Eire" , 0x029763 }, - { "EST" , 0x029C74 }, - { "EST5EDT" , 0x029CB8 }, - { "Etc/GMT" , 0x02A009 }, - { "Etc/GMT+0" , 0x02A0D5 }, - { "Etc/GMT+1" , 0x02A15F }, - { "Etc/GMT+10" , 0x02A1EC }, - { "Etc/GMT+11" , 0x02A27A }, - { "Etc/GMT+12" , 0x02A308 }, - { "Etc/GMT+2" , 0x02A423 }, - { "Etc/GMT+3" , 0x02A4AF }, - { "Etc/GMT+4" , 0x02A53B }, - { "Etc/GMT+5" , 0x02A5C7 }, - { "Etc/GMT+6" , 0x02A653 }, - { "Etc/GMT+7" , 0x02A6DF }, - { "Etc/GMT+8" , 0x02A76B }, - { "Etc/GMT+9" , 0x02A7F7 }, - { "Etc/GMT-0" , 0x02A091 }, - { "Etc/GMT-1" , 0x02A119 }, - { "Etc/GMT-10" , 0x02A1A5 }, - { "Etc/GMT-11" , 0x02A233 }, - { "Etc/GMT-12" , 0x02A2C1 }, - { "Etc/GMT-13" , 0x02A34F }, - { "Etc/GMT-14" , 0x02A396 }, - { "Etc/GMT-2" , 0x02A3DD }, - { "Etc/GMT-3" , 0x02A469 }, - { "Etc/GMT-4" , 0x02A4F5 }, - { "Etc/GMT-5" , 0x02A581 }, - { "Etc/GMT-6" , 0x02A60D }, - { "Etc/GMT-7" , 0x02A699 }, - { "Etc/GMT-8" , 0x02A725 }, - { "Etc/GMT-9" , 0x02A7B1 }, - { "Etc/GMT0" , 0x02A04D }, - { "Etc/Greenwich" , 0x02A83D }, - { "Etc/UCT" , 0x02A881 }, - { "Etc/Universal" , 0x02A8C5 }, - { "Etc/UTC" , 0x02A909 }, - { "Etc/Zulu" , 0x02A94D }, - { "Europe/Amsterdam" , 0x02A991 }, - { "Europe/Andorra" , 0x02ADCF }, - { "Europe/Athens" , 0x02B04B }, - { "Europe/Belfast" , 0x02B38E }, - { "Europe/Belgrade" , 0x02B8C5 }, - { "Europe/Berlin" , 0x02BB8E }, - { "Europe/Bratislava" , 0x02BEF2 }, - { "Europe/Brussels" , 0x02C224 }, - { "Europe/Bucharest" , 0x02C65B }, - { "Europe/Budapest" , 0x02C985 }, - { "Europe/Busingen" , 0x02CCEE }, - { "Europe/Chisinau" , 0x02CFA5 }, - { "Europe/Copenhagen" , 0x02D333 }, - { "Europe/Dublin" , 0x02D63D }, - { "Europe/Gibraltar" , 0x02DB4E }, - { "Europe/Guernsey" , 0x02DFA5 }, - { "Europe/Helsinki" , 0x02E4DC }, - { "Europe/Isle_of_Man" , 0x02E792 }, - { "Europe/Istanbul" , 0x02ECC9 }, - { "Europe/Jersey" , 0x02F0B6 }, - { "Europe/Kaliningrad" , 0x02F5ED }, - { "Europe/Kiev" , 0x02F858 }, - { "Europe/Lisbon" , 0x02FB74 }, - { "Europe/Ljubljana" , 0x030078 }, - { "Europe/London" , 0x030341 }, - { "Europe/Luxembourg" , 0x030878 }, - { "Europe/Madrid" , 0x030CCE }, - { "Europe/Malta" , 0x031094 }, - { "Europe/Mariehamn" , 0x03144D }, - { "Europe/Minsk" , 0x031703 }, - { "Europe/Monaco" , 0x031916 }, - { "Europe/Moscow" , 0x031D51 }, - { "Europe/Nicosia" , 0x031FAB }, - { "Europe/Oslo" , 0x032293 }, - { "Europe/Paris" , 0x0325C5 }, - { "Europe/Podgorica" , 0x032A0B }, - { "Europe/Prague" , 0x032CD4 }, - { "Europe/Riga" , 0x033006 }, - { "Europe/Rome" , 0x03334B }, - { "Europe/Samara" , 0x03370E }, - { "Europe/San_Marino" , 0x033977 }, - { "Europe/Sarajevo" , 0x033D3A }, - { "Europe/Simferopol" , 0x034003 }, - { "Europe/Skopje" , 0x034254 }, - { "Europe/Sofia" , 0x03451D }, - { "Europe/Stockholm" , 0x034825 }, - { "Europe/Tallinn" , 0x034AD4 }, - { "Europe/Tirane" , 0x034E0E }, - { "Europe/Tiraspol" , 0x035114 }, - { "Europe/Uzhgorod" , 0x0354A2 }, - { "Europe/Vaduz" , 0x0357B9 }, - { "Europe/Vatican" , 0x035A68 }, - { "Europe/Vienna" , 0x035E2B }, - { "Europe/Vilnius" , 0x036158 }, - { "Europe/Volgograd" , 0x036497 }, - { "Europe/Warsaw" , 0x0366B8 }, - { "Europe/Zagreb" , 0x036A99 }, - { "Europe/Zaporozhye" , 0x036D62 }, - { "Europe/Zurich" , 0x0370A3 }, - { "Factory" , 0x037352 }, - { "GB" , 0x0373C3 }, - { "GB-Eire" , 0x0378FA }, - { "GMT" , 0x037E31 }, - { "GMT+0" , 0x037EFD }, - { "GMT-0" , 0x037EB9 }, - { "GMT0" , 0x037E75 }, - { "Greenwich" , 0x037F41 }, - { "Hongkong" , 0x037F85 }, - { "HST" , 0x038147 }, - { "Iceland" , 0x03818B }, - { "Indian/Antananarivo" , 0x038344 }, - { "Indian/Chagos" , 0x0383B8 }, - { "Indian/Christmas" , 0x03841A }, - { "Indian/Cocos" , 0x03845E }, - { "Indian/Comoro" , 0x0384A2 }, - { "Indian/Kerguelen" , 0x0384F7 }, - { "Indian/Mahe" , 0x03854C }, - { "Indian/Maldives" , 0x0385A1 }, - { "Indian/Mauritius" , 0x0385F6 }, - { "Indian/Mayotte" , 0x03866C }, - { "Indian/Reunion" , 0x0386C1 }, - { "Iran" , 0x038716 }, - { "Israel" , 0x038984 }, - { "Jamaica" , 0x038CB3 }, - { "Japan" , 0x038D78 }, - { "Kwajalein" , 0x038E02 }, - { "Libya" , 0x038E65 }, - { "MET" , 0x038F6E }, - { "Mexico/BajaNorte" , 0x039277 }, - { "Mexico/BajaSur" , 0x0395E0 }, - { "Mexico/General" , 0x039825 }, - { "MST" , 0x039A83 }, - { "MST7MDT" , 0x039AC7 }, - { "Navajo" , 0x039E18 }, - { "NZ" , 0x03A191 }, - { "NZ-CHAT" , 0x03A50F }, - { "Pacific/Apia" , 0x03A7F3 }, - { "Pacific/Auckland" , 0x03A98F }, - { "Pacific/Bougainville" , 0x03AD1B }, - { "Pacific/Chatham" , 0x03AD92 }, - { "Pacific/Chuuk" , 0x03B085 }, - { "Pacific/Easter" , 0x03B0DE }, - { "Pacific/Efate" , 0x03B42D }, - { "Pacific/Enderbury" , 0x03B4F3 }, - { "Pacific/Fakaofo" , 0x03B561 }, - { "Pacific/Fiji" , 0x03B5B2 }, - { "Pacific/Funafuti" , 0x03B745 }, - { "Pacific/Galapagos" , 0x03B789 }, - { "Pacific/Gambier" , 0x03B801 }, - { "Pacific/Guadalcanal" , 0x03B866 }, - { "Pacific/Guam" , 0x03B8BB }, - { "Pacific/Honolulu" , 0x03B911 }, - { "Pacific/Johnston" , 0x03B988 }, - { "Pacific/Kiritimati" , 0x03BA07 }, - { "Pacific/Kosrae" , 0x03BA72 }, - { "Pacific/Kwajalein" , 0x03BACF }, - { "Pacific/Majuro" , 0x03BB3B }, - { "Pacific/Marquesas" , 0x03BB9A }, - { "Pacific/Midway" , 0x03BC01 }, - { "Pacific/Nauru" , 0x03BC8B }, - { "Pacific/Niue" , 0x03BD03 }, - { "Pacific/Norfolk" , 0x03BD61 }, - { "Pacific/Noumea" , 0x03BDB6 }, - { "Pacific/Pago_Pago" , 0x03BE46 }, - { "Pacific/Palau" , 0x03BEBD }, - { "Pacific/Pitcairn" , 0x03BF01 }, - { "Pacific/Pohnpei" , 0x03BF56 }, - { "Pacific/Ponape" , 0x03BFAB }, - { "Pacific/Port_Moresby" , 0x03BFF0 }, - { "Pacific/Rarotonga" , 0x03C042 }, - { "Pacific/Saipan" , 0x03C11E }, - { "Pacific/Samoa" , 0x03C181 }, - { "Pacific/Tahiti" , 0x03C1F8 }, - { "Pacific/Tarawa" , 0x03C25D }, - { "Pacific/Tongatapu" , 0x03C2B1 }, - { "Pacific/Truk" , 0x03C33D }, - { "Pacific/Wake" , 0x03C382 }, - { "Pacific/Wallis" , 0x03C3D2 }, - { "Pacific/Yap" , 0x03C416 }, - { "Poland" , 0x03C45B }, - { "Portugal" , 0x03C83C }, - { "PRC" , 0x03CD38 }, - { "PST8PDT" , 0x03CDD8 }, - { "ROC" , 0x03D129 }, - { "ROK" , 0x03D25A }, - { "Singapore" , 0x03D321 }, - { "Turkey" , 0x03D3D8 }, - { "UCT" , 0x03D7C5 }, - { "Universal" , 0x03D809 }, - { "US/Alaska" , 0x03D84D }, - { "US/Aleutian" , 0x03DBB6 }, - { "US/Arizona" , 0x03DF1C }, - { "US/Central" , 0x03DFAA }, - { "US/East-Indiana" , 0x03E9B4 }, - { "US/Eastern" , 0x03E4B5 }, - { "US/Hawaii" , 0x03EC1E }, - { "US/Indiana-Starke" , 0x03EC8F }, - { "US/Michigan" , 0x03F000 }, - { "US/Mountain" , 0x03F337 }, - { "US/Pacific" , 0x03F6B0 }, - { "US/Pacific-New" , 0x03FAB5 }, - { "US/Samoa" , 0x03FEBA }, - { "UTC" , 0x03FF31 }, - { "W-SU" , 0x040228 }, - { "WET" , 0x03FF75 }, - { "Zulu" , 0x04046B }, + { "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[263343] = { +const unsigned char timelib_timezone_db_data_builtin[263744] = { /* Africa/Abidjan */ @@ -620,11 +620,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -649,19 +651,23 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -895,20 +901,23 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -1011,9 +1020,9 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -1140,11 +1149,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -3306,7 +3317,7 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -3325,15 +3336,15 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { 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, @@ -9074,14 +9085,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -9214,17 +9224,20 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -16232,12 +16245,12 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -16264,11 +16277,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -16306,11 +16321,13 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -17688,17 +17705,20 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { /* 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, @@ -18547,4 +18567,4 @@ const unsigned char timelib_timezone_db_data_builtin[263343] = { 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.9", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; +const timelib_tzdb timezonedb_builtin = { "2014.10", 583, timezonedb_idx_builtin, timelib_timezone_db_data_builtin }; -- cgit v1.2.1 From 4571cc2195dfba340c39952fa3cbb545c5d41f0e Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Tue, 4 Nov 2014 21:48:44 -0800 Subject: fix copypaste error --- ext/standard/html.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/standard/html.c b/ext/standard/html.c index fd210c8086..1d6eaa4c5c 100644 --- a/ext/standard/html.c +++ b/ext/standard/html.c @@ -395,7 +395,7 @@ static enum entity_charset determine_charset(char *charset_hint TSRMLS_DC) if ((len == 4) /* sizeof (none|auto|pass) */ && (!memcmp("pass", charset_hint, 4) || !memcmp("auto", charset_hint, 4) || - !memcmp("auto", charset_hint, 4))) { + !memcmp("none", charset_hint, 4))) { charset_hint = NULL; len = 0; } else { -- cgit v1.2.1 From 1b143f4033d65141cdfc0615bd7e95d4b88b3f6f Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Tue, 4 Nov 2014 21:58:44 -0800 Subject: fix loop - size_t is unsigned so can not be negative --- ext/standard/ftp_fopen_wrapper.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'ext') diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index d6eb3b8fbc..ab75da713c 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -644,11 +644,10 @@ static size_t php_ftp_dirstream_read(php_stream *stream, char *buf, size_t count efree(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'; + while (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); -- cgit v1.2.1 From 32fd4590a5b9572e90548ce3d251defc3f6c4421 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Tue, 4 Nov 2014 21:58:44 -0800 Subject: fix loop - size_t is unsigned so can not be negative --- ext/standard/ftp_fopen_wrapper.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'ext') 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); -- cgit v1.2.1 From 9e072d9565425c306800354e4723b340578f6ca1 Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Wed, 12 Nov 2014 13:40:27 +0900 Subject: Remove unneeded md5 hashing from PHP-5.6 branch. It's removed from master already by my previous commit. --- ext/session/session.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'ext') diff --git a/ext/session/session.c b/ext/session/session.c index edc8f15d5b..d561c558b0 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -538,13 +538,6 @@ static void php_session_save_current_state(TSRMLS_D) /* {{{ */ val = php_session_encode(&vallen TSRMLS_CC); if (val) { - PHP_MD5_CTX context; - unsigned char digest[16]; - - /* Generate data's MD5 hash */ - PHP_MD5Init(&context); - PHP_MD5Update(&context, val, vallen); - PHP_MD5Final(digest, &context); ret = PS(mod)->s_write(&PS(mod_data), PS(id), val, vallen TSRMLS_CC); efree(val); } else { -- cgit v1.2.1 From 65fee904622160781db05b0a469d67b4414cbd7f Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Wed, 12 Nov 2014 11:21:11 +0100 Subject: Fixed bug #53829 Compiling PHP with large file support will replace function gzopen by gzopen64 --- ext/zlib/zlib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ext') diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 705fb5dd5f..25804597bc 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 */ -- cgit v1.2.1 From d7a00464686b5f4009a2248e9b010737c19cb13a Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 12 Nov 2014 17:56:47 +0100 Subject: fix test cleanup --- ext/pgsql/tests/80_bug36625.phpt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ext') 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-- - + --EXPECTF-- bool(false) resource(%d) of type (pgsql result) -- cgit v1.2.1 From 39913c4cdf54f926d733bfe0a95be2ecfa6bff35 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Thu, 13 Nov 2014 12:20:16 +0800 Subject: Fixed test fails (prop read always has a IS_STRING member now) --- ext/pdo/pdo_stmt.c | 114 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 70 insertions(+), 44 deletions(-) (limited to 'ext') diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 705d08bacf..8f68aef8ab 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2480,38 +2480,48 @@ const zend_function_entry pdo_row_functions[] = { {NULL, NULL, NULL} }; -static zval *row_prop_read(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) +static zend_always_inline zval *row_prop_read_impl(zval *object, zval *member, int type, void **cache_slot, zval *rv, int dim_access TSRMLS_DC) { pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object); pdo_stmt_t *stmt = row->stmt; int colno = -1; zval zobj; + zend_long lval; ZVAL_NULL(rv); if (stmt) { - if (Z_TYPE_P(member) == IS_LONG) { - if (Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count) { - fetch_value(stmt, rv, Z_LVAL_P(member), NULL TSRMLS_CC); + if (dim_access) { + if (Z_TYPE_P(member) == IS_LONG) { + if (Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count) { + fetch_value(stmt, rv, Z_LVAL_P(member), NULL TSRMLS_CC); + } + return rv; } - } 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) { - fetch_value(stmt, rv, colno, NULL TSRMLS_CC); - //??? - //Z_SET_REFCOUNT_P(rv, 0); - //Z_UNSET_ISREF_P(rv); - return rv; + } else { + if (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); } + return rv; } - if (strcmp(Z_STRVAL_P(member), "queryString") == 0) { - ZVAL_OBJ(&zobj, &stmt->std); - //zval_ptr_dtor(rv); - return std_object_handlers.read_property(&zobj, member, type, cache_slot, rv TSRMLS_CC); + } + /* 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) { + fetch_value(stmt, rv, colno, NULL TSRMLS_CC); + //??? + //Z_SET_REFCOUNT_P(rv, 0); + //Z_UNSET_ISREF_P(rv); + return rv; } } + if (strcmp(Z_STRVAL_P(member), "queryString") == 0) { + ZVAL_OBJ(&zobj, &stmt->std); + //zval_ptr_dtor(rv); + return std_object_handlers.read_property(&zobj, member, type, cache_slot, rv TSRMLS_CC); + } } //??? @@ -2521,39 +2531,30 @@ static zval *row_prop_read(zval *object, zval *member, int type, void **cache_sl return rv; } -static zval *row_dim_read(zval *object, zval *member, int type, zval *rv TSRMLS_DC) -{ - return row_prop_read(object, member, type, NULL, rv TSRMLS_CC); -} - -static void row_prop_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set"); -} - -static void row_dim_write(zval *object, zval *member, zval *value TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set"); -} - -static int row_prop_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC) +static zend_always_inline int row_prop_exists_impl(zval *object, zval *member, int check_empty, void **cache_slot, int dim_access TSRMLS_DC) { 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 (dim_access) { + if (Z_TYPE_P(member) == IS_LONG) { + return Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count; + } convert_to_string(member); + } else { + 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; + } + } - /* 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; } } } @@ -2561,9 +2562,34 @@ static int row_prop_exists(zval *object, zval *member, int check_empty, void **c return 0; } +static zval *row_prop_read(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) +{ + return row_prop_read_impl(object, member, type, cache_slot, rv, 0 TSRMLS_CC); +} + +static int row_prop_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC) +{ + return row_prop_exists_impl(object, member, check_empty, cache_slot, 0 TSRMLS_CC); +} + +static zval *row_dim_read(zval *object, zval *member, int type, zval *rv TSRMLS_DC) +{ + return row_prop_read_impl(object, member, type, NULL, rv, 1 TSRMLS_CC); +} + +static void row_prop_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) +{ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set"); +} + +static void row_dim_write(zval *object, zval *member, zval *value TSRMLS_DC) +{ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set"); +} + static int row_dim_exists(zval *object, zval *member, int check_empty TSRMLS_DC) { - return row_prop_exists(object, member, check_empty, NULL TSRMLS_CC); + return row_prop_exists_impl(object, member, check_empty, NULL, 1 TSRMLS_CC); } static void row_prop_delete(zval *object, zval *offset, void **cache_slot TSRMLS_DC) -- cgit v1.2.1 From 241b1a78401771c78a8f6c76dbad43de6053c558 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Thu, 13 Nov 2014 14:16:08 +0800 Subject: Revert "Fixed test fails (prop read always has a IS_STRING member now)" This reverts commit 39913c4cdf54f926d733bfe0a95be2ecfa6bff35. --- ext/pdo/pdo_stmt.c | 114 +++++++++++++++++++++-------------------------------- 1 file changed, 44 insertions(+), 70 deletions(-) (limited to 'ext') diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 8f68aef8ab..705d08bacf 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2480,48 +2480,38 @@ const zend_function_entry pdo_row_functions[] = { {NULL, NULL, NULL} }; -static zend_always_inline zval *row_prop_read_impl(zval *object, zval *member, int type, void **cache_slot, zval *rv, int dim_access TSRMLS_DC) +static zval *row_prop_read(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) { pdo_row_t *row = (pdo_row_t *)Z_OBJ_P(object); pdo_stmt_t *stmt = row->stmt; int colno = -1; zval zobj; - zend_long lval; ZVAL_NULL(rv); if (stmt) { - if (dim_access) { - if (Z_TYPE_P(member) == IS_LONG) { - if (Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count) { - fetch_value(stmt, rv, Z_LVAL_P(member), NULL TSRMLS_CC); - } - return rv; + if (Z_TYPE_P(member) == IS_LONG) { + if (Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count) { + fetch_value(stmt, rv, Z_LVAL_P(member), NULL TSRMLS_CC); } - convert_to_string(member); } else { - if (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); + 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) { + fetch_value(stmt, rv, colno, NULL TSRMLS_CC); + //??? + //Z_SET_REFCOUNT_P(rv, 0); + //Z_UNSET_ISREF_P(rv); + return rv; } - return rv; } - } - /* 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) { - fetch_value(stmt, rv, colno, NULL TSRMLS_CC); - //??? - //Z_SET_REFCOUNT_P(rv, 0); - //Z_UNSET_ISREF_P(rv); - return rv; + if (strcmp(Z_STRVAL_P(member), "queryString") == 0) { + ZVAL_OBJ(&zobj, &stmt->std); + //zval_ptr_dtor(rv); + return std_object_handlers.read_property(&zobj, member, type, cache_slot, rv TSRMLS_CC); } } - if (strcmp(Z_STRVAL_P(member), "queryString") == 0) { - ZVAL_OBJ(&zobj, &stmt->std); - //zval_ptr_dtor(rv); - return std_object_handlers.read_property(&zobj, member, type, cache_slot, rv TSRMLS_CC); - } } //??? @@ -2531,30 +2521,39 @@ static zend_always_inline zval *row_prop_read_impl(zval *object, zval *member, i return rv; } -static zend_always_inline int row_prop_exists_impl(zval *object, zval *member, int check_empty, void **cache_slot, int dim_access TSRMLS_DC) +static zval *row_dim_read(zval *object, zval *member, int type, zval *rv TSRMLS_DC) +{ + return row_prop_read(object, member, type, NULL, rv TSRMLS_CC); +} + +static void row_prop_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) +{ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set"); +} + +static void row_dim_write(zval *object, zval *member, zval *value TSRMLS_DC) +{ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set"); +} + +static int row_prop_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC) { 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 (dim_access) { - if (Z_TYPE_P(member) == IS_LONG) { - return Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count; - } - convert_to_string(member); + if (Z_TYPE_P(member) == IS_LONG) { + return Z_LVAL_P(member) >= 0 && Z_LVAL_P(member) < stmt->column_count; } else { - 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; - } - } + 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; + } } } } @@ -2562,34 +2561,9 @@ static zend_always_inline int row_prop_exists_impl(zval *object, zval *member, i return 0; } -static zval *row_prop_read(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) -{ - return row_prop_read_impl(object, member, type, cache_slot, rv, 0 TSRMLS_CC); -} - -static int row_prop_exists(zval *object, zval *member, int check_empty, void **cache_slot TSRMLS_DC) -{ - return row_prop_exists_impl(object, member, check_empty, cache_slot, 0 TSRMLS_CC); -} - -static zval *row_dim_read(zval *object, zval *member, int type, zval *rv TSRMLS_DC) -{ - return row_prop_read_impl(object, member, type, NULL, rv, 1 TSRMLS_CC); -} - -static void row_prop_write(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set"); -} - -static void row_dim_write(zval *object, zval *member, zval *value TSRMLS_DC) -{ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "This PDORow is not from a writable result set"); -} - static int row_dim_exists(zval *object, zval *member, int check_empty TSRMLS_DC) { - return row_prop_exists_impl(object, member, check_empty, NULL, 1 TSRMLS_CC); + return row_prop_exists(object, member, check_empty, NULL TSRMLS_CC); } static void row_prop_delete(zval *object, zval *offset, void **cache_slot TSRMLS_DC) -- cgit v1.2.1 From 6771f5590c88c5550ccd43c9ac4c5c4448bf45ef Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Thu, 13 Nov 2014 14:23:25 +0800 Subject: Another fix for test fail --- ext/pdo/pdo_stmt.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'ext') 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; } } } -- cgit v1.2.1 From c865472ef0c431cf3c6ec153736881d13e8a6883 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 13 Nov 2014 14:17:41 +0100 Subject: fix datatype mismatches, remove dead part of code --- ext/com_dotnet/com_typeinfo.c | 6 +++--- ext/com_dotnet/com_variant.c | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'ext') diff --git a/ext/com_dotnet/com_typeinfo.c b/ext/com_dotnet/com_typeinfo.c index 17b69d2460..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 = (DWORD)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; diff --git a/ext/com_dotnet/com_variant.c b/ext/com_dotnet/com_variant.c index 6a81eed102..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 = (ULONG)(intindex + 1); + bound.cElements = zend_hash_num_elements(HASH_OF(z)); sa = SafeArrayCreate(VT_VARIANT, 1, &bound); /* get a lock on the array itself */ -- cgit v1.2.1 From 5f81cfe097219dfc77eb63ad6613246f07f16850 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 13 Nov 2014 14:27:38 +0100 Subject: fix datatype mismatch and kick unused var --- ext/com_dotnet/com_com.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ext') diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index e1a9503dff..7de6d949bb 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -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 */ @@ -693,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; -- cgit v1.2.1 From e5acd78f7a55c32b84d367975e3b123ea0c3a010 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Thu, 13 Nov 2014 15:27:53 +0100 Subject: fix datatype mismatch --- ext/com_dotnet/com_extension.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext') diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index 7e15865950..e4ed4916af 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -387,7 +387,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); \ } -- cgit v1.2.1 From 3b4a6dc11496dbdf22a5a83966f963107d20234e Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 14 Nov 2014 09:46:06 +0100 Subject: removed useless check the offset member is an unsigned --- ext/reflection/php_reflection.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'ext') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b972c2899c..e9c59ea86e 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -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[OBJ_PROP_TO_NUM(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; -- cgit v1.2.1 From 8434a7f2abb6ee5be0a4b38c1a7add6cdc21a426 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 14 Nov 2014 10:17:43 +0100 Subject: validate sockets portable way --- ext/mysqlnd/mysqlnd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') 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; -- cgit v1.2.1 From dbddbcc950aec9956aaa942d1983981110984edd Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 14 Nov 2014 10:31:35 +0100 Subject: remove unused var --- ext/standard/exec.c | 1 - 1 file changed, 1 deletion(-) (limited to 'ext') diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 6106fe2c86..01aaa71f39 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -242,7 +242,6 @@ 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; -- cgit v1.2.1 From a85ce501da60999ded0f93d9889efa6792b2a6ec Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 14 Nov 2014 11:27:23 +0100 Subject: partial cleanup to work with size_t str length in password_hash php_crypt() and co use int, though this is fair enough. Could be refactored later for tidiness reasons. --- ext/standard/password.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'ext') diff --git a/ext/standard/password.c b/ext/standard/password.c index c58c28ab3c..cd2170b036 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,18 @@ 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) { + } 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 +395,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; -- cgit v1.2.1 From 82c2e3f20148b88b0721b6887edb9280b45e90f2 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 14 Nov 2014 22:19:41 +0100 Subject: fix build ifdef this var declaration to avoid the vs warning --- ext/standard/exec.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ext') diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 01aaa71f39..15e4876af5 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -244,6 +244,9 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str) register int x, y, l = (int)strlen(str); size_t estimate = (2 * l) + 1; zend_string *cmd; +#ifndef PHP_WIN32 + char *p = NULL; +#endif TSRMLS_FETCH(); -- cgit v1.2.1 From e20a727430713cc4ab81bc8faad64d616837c787 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 18 Nov 2014 14:37:36 +0300 Subject: SEND_VAR_NO_REF optimization --- ext/opcache/Optimizer/optimize_func_calls.c | 2 -- ext/opcache/Optimizer/zend_optimizer.c | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'ext') 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/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) { -- cgit v1.2.1 From f8f86a44ef108e7fcd7e8bc810e7c8ee3dd684a2 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 18 Nov 2014 12:34:45 +0100 Subject: return after the warning, to fix uninitialized salt usage --- ext/standard/password.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ext') diff --git a/ext/standard/password.c b/ext/standard/password.c index cd2170b036..4f211dd35f 100644 --- a/ext/standard/password.c +++ b/ext/standard/password.c @@ -384,6 +384,7 @@ PHP_FUNCTION(password_hash) efree(hash_format); efree(buffer); php_error_docref(NULL TSRMLS_CC, E_WARNING, "Supplied salt is too long"); + RETURN_NULL(); } else if (buffer_len < required_salt_len) { efree(hash_format); efree(buffer); -- cgit v1.2.1 From 075fc1ff1a37a096438e7cbffe7f8e4cca98c111 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 18 Nov 2014 13:13:23 +0100 Subject: fix some datatype mismatches --- ext/wddx/php_wddx_api.h | 2 +- ext/wddx/wddx.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'ext') 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); -- cgit v1.2.1 From 376a366f0cce0c2bea36e5e06d8710675957c626 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 18 Nov 2014 13:17:43 +0100 Subject: move to size_t where zend_string is used internally --- ext/standard/incomplete_class.c | 2 +- ext/standard/php_incomplete_class.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') 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/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 }; -- cgit v1.2.1 From 5400f92c751a78452a4cf74b7b25e30b2508bf56 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 18 Nov 2014 15:38:35 +0100 Subject: proper dllexport --- ext/standard/php_fopen_wrapper.c | 2 +- ext/standard/php_fopen_wrappers.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ext') 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 -- cgit v1.2.1