diff --git a/EXTENSIONS b/EXTENSIONS index fd454dfc541bd..4e0af33ebf03f 100644 --- a/EXTENSIONS +++ b/EXTENSIONS @@ -205,7 +205,7 @@ STATUS: Working SINCE: 5.1 ------------------------------------------------------------------------------- EXTENSION: pdo_oci -PRIMARY MAINTAINER: Unknown +PRIMARY MAINTAINER: Christopher Jones MAINTENANCE: Odd fixes STATUS: Working SINCE: 5.1 diff --git a/NEWS b/NEWS index 6215ecc3e0aed..531d6266b4126 100644 --- a/NEWS +++ b/NEWS @@ -1,26 +1,243 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| -07 Jul 2016, PHP 5.6.24RC1 +?? ??? 2016, PHP 5.6.26 - Core: - . Fix bug #71936 (Segmentation fault destroying HTTP_RAW_POST_DATA). + . Fixed bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer + (zend_gc.c:260)). (Laruence) + . Fixed bug #72703 (Out of bounds global memory read in BF_crypt triggered by + password_verify). (Anatol) + +- Dba: + . Fixed bug #71514 (Bad dba_replace condition because of wrong API usage). + (cmb) + . Fixed bug #70825 (Cannot fetch multiple values with group in ini file). + (cmb) + +- Streams: + . Fixed bug #72853 (stream_set_blocking doesn't work). (Laruence) + +- FTP: + . Fixed bug #70195 (Cannot upload file using ftp_put to FTPES with + require_ssl_reuse). (Benedict Singer) + +- GD: + . Fixed bug #66005 (imagecopy does not support 1bit transparency on truecolor + images). (cmb) + . Fixed bug #72913 (imagecopy() loses single-color transparency on palette + images). (cmb) + . Fixed bug #68716 (possible resource leaks in _php_image_convert()). (cmb) + +- JSON: + . Fixed bug #72787 (json_decode reads out of bounds). (Jakub Zelenka) + +- mbstring: + . Fixed bug #66797 (mb_substr only takes 32-bit signed integer). (cmb) + +- MSSQL: + . Fixed bug #72039 (Use of uninitialised value on mssql_guid_string). (Kalle) + +- PDO: + . Fixed bug #60665 (call to empty() on NULL result using PDO::FETCH_LAZY + returns false). (cmb) + +- PDO_pgsql: + . Implemented FR #72633 (Postgres PDO lastInsertId() should work without + specifying a sequence). (Pablo Santiago Sánchez, Matteo) + . Fixed bug #72759 (Regression in pgo_pgsql). (Anatol) + +- Standard: + . Fixed bug #72823 (strtr out-of-bound access). (cmb) + . Fixed bug #72278 (getimagesize returning FALSE on valid jpg). (cmb) + . Fixed bug #65550 (get_browser() incorrectly parses entries with "+" sign). + (cmb) + . Fixed bug #71882 (Negative ftruncate() on php://memory exhausts memory). + (cmb) + +- XML: + . Fixed bug #72085 (SEGV on unknown address zif_xml_parse). (cmb) + +- ZIP: + . Fixed bug #68302 (impossible to compile php with zip support). (cmb) + +18 Aug 2016, PHP 5.6.25 + +- Bz2: + . Fixed bug #72837 (integer overflow in bzdecompress caused heap + corruption). (Stas) + +- Core: + . Fixed bug #70436 (Use After Free Vulnerability in unserialize()). + (Taoguang Chen) + . Fixed bug #72024 (microtime() leaks memory). (maroszek at gmx dot net) + . Fixed bug #72581 (previous property undefined in Exception after + deserialization). (Laruence) + . Implemented FR #72614 (Support "nmake test" on building extensions by + phpize). (Yuji Uchiyama) + . Fixed bug #72641 (phpize (on Windows) ignores PHP_PREFIX). + (Yuji Uchiyama) + . Fixed bug #72663 (Create an Unexpected Object and Don't Invoke + __wakeup() in Deserialization). (Stas) + . Fixed bug #72681 (PHP Session Data Injection Vulnerability). (Stas) + +- Calendar: + . Fixed bug #67976 (cal_days_month() fails for final month of the French + calendar). (cmb) + . Fixed bug #71894 (AddressSanitizer: global-buffer-overflow in + zif_cal_from_jd). (cmb) + +- Curl: + . Fixed bug #71144 (Segmentation fault when using cURL with ZTS). + (maroszek at gmx dot net) + . Fixed bug #71929 (Certification information (CERTINFO) data parsing error). + (Pierrick) + . Fixed bug #72807 (integer overflow in curl_escape caused heap + corruption). (Stas) + +- DOM: + . Fixed bug #66502 (DOM document dangling reference). (Sean Heelan, cmb) + +- Ereg: + . Fixed bug #72838 (Integer overflow lead to heap corruption in + sql_regcase). (Stas) + +- EXIF: + . Fixed bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF). (Stas) + . Fixed bug #72735 (Samsung picture thumb not read (zero size)). (Kalle, Remi) + +- Filter: + . Fixed bug #71745 (FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8 + range). (bugs dot php dot net at majkl578 dot cz) + +- FPM: + . Fixed bug #72575 (using --allow-to-run-as-root should ignore missing user). + (gooh) + +- GD: + . Fixed bug #43828 (broken transparency of imagearc for truecolor in + blendingmode). (cmb) + . Fixed bug #66555 (Always false condition in ext/gd/libgd/gdkanji.c). (cmb) + . Fixed bug #68712 (suspicious if-else statements). (cmb) + . Fixed bug #70315 (500 Server Error but page is fully rendered). (cmb) + . Fixed bug #72596 (imagetypes function won't advertise WEBP support). (cmb) + . Fixed bug #72604 (imagearc() ignores thickness for full arcs). (cmb) + . Fixed bug #72697 (select_colors write out-of-bounds). (Stas) + . Fixed bug #72709 (imagesetstyle() causes OOB read for empty $styles). (cmb) + . Fixed bug #72730 (imagegammacorrect allows arbitrary write access). (Stas) + +- Intl: + . Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain + names). (cmb) + +- mbstring: + . Fixed bug #72691 (mb_ereg_search raises a warning if a match zero-width). + (cmb) + . Fixed bug #72693 (mb_ereg_search increments search position when a match + zero-width). (cmb) + . Fixed bug #72694 (mb_ereg_search_setpos does not accept a string's last + position). (cmb) + . Fixed bug #72710 (`mb_ereg` causes buffer overflow on regexp compile error). + (ju1ius) + +- OCI8: + . Fixed invalid handle error with Implicit Result Sets. (Chris Jones) + +- PCRE: + . Fixed bug #72688 (preg_match missing group names in matches). (cmb) + +- PDO_pgsql: + . Fixed bug #70313 (PDO statement fails to throw exception). (Matteo) + +- Reflection: + . Fixed bug #72222 (ReflectionClass::export doesn't handle array constants). + (Nikita Nefedov) + +- SNMP: + . Fixed bug #72708 (php_snmp_parse_oid integer overflow in memory + allocation). (djodjo at gmail dot com) + +- Standard: + . Fixed bug #72330 (CSV fields incorrectly split if escape char followed by + UTF chars). (cmb) + . Fixed bug #72836 (integer overflow in base64_decode). (Stas) + . Fixed bug #72848 (integer overflow in quoted_printable_encode). (Stas) + . Fixed bug #72849 (integer overflow in urlencode). (Stas) + . Fixed bug #72850 (integer overflow in php_uuencode). (Stas) + +- Streams: + . Fixed bug #41021 (Problems with the ftps wrapper). (vhuk) + . Fixed bug #54431 (opendir() does not work with ftps:// wrapper). (vhuk) + . Fixed bug #72667 (opendir() with ftp:// attempts to open data stream for + non-existent directories). (vhuk) + . Fixed bug #72764 (ftps:// opendir wrapper data channel encryption fails + with IIS FTP 7.5, 8.5). (vhuk) + . Fixed bug #72771 (ftps:// wrapper is vulnerable to protocol downgrade + attack). (Stas) + +- SPL: + . Fixed bug #72122 (IteratorIterator breaks '@' error suppression). (kinglozzer) + . Fixed bug #72646 (SplFileObject::getCsvControl does not return the escape + character). (cmb) + . Fixed bug #72684 (AppendIterator segfault with closed generator). (Pierrick) + +- SQLite3: + . Implemented FR #72653 (SQLite should allow opening with empty filename). + (cmb) + +- Wddx: + . Fixed bug #72142 (WDDX Packet Injection Vulnerability in + wddx_serialize_value()). (Taoguang Chen) + . Fixed bug #72749 (wddx_deserialize allows illegal memory access) (Stas) + . Fixed bug #72750 (wddx_deserialize null dereference). (Stas) + . Fixed bug #72790 (wddx_deserialize null dereference with invalid xml). + (Stas) + . Fixed bug #72799 (wddx_deserialize null dereference in + php_wddx_pop_element). (Stas) + +21 Jul 2016, PHP 5.6.24 + +- Core: + . Fixed bug #71936 (Segmentation fault destroying HTTP_RAW_POST_DATA). (mike dot laspina at gmail dot com, Remi) - . Fix bug #72496 (Cannot declare public method with signature incompatible + . Fixed bug #72496 (Cannot declare public method with signature incompatible with parent private method). (Pedro Magalhães) - . Fix bug #72138 (Integer Overflow in Length of String-typed ZVAL). (Stas) + . Fixed bug #72138 (Integer Overflow in Length of String-typed ZVAL). (Stas) + . Fixed bug #72513 (Stack-based buffer overflow vulnerability in + virtual_file_ex). (loianhtuan at gmail dot com) + . Fixed bug #72562 (Use After Free in unserialize() with Unexpected Session + Deserialization). (taoguangchen at icloud dot com) + . Fixed bug #72573 (HTTP_PROXY is improperly trusted by some PHP libraries and + applications). (CVE-2016-5385) (Stas) - bz2: - . Fix bug #72447 (Type Confusion in php_bz2_filter_create()). (gogil at + . Fixed bug #72447 (Type Confusion in php_bz2_filter_create()). (gogil at stealien dot com). + . Fixed bug #72613 (Inadequate error handling in bzread()). (Stas) + +- Date: + . Fixed bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails + parsing). (derick) - EXIF: . Fixed bug #50845 (exif_read_data() returns corrupted exif headers). (Bartosz Dziewoński) + . Fixed bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE). + (Stas) + . Fixed bug #72618 (NULL Pointer Dereference in exif_process_user_comment). + (Stas) - GD: . Fixed bug #43475 (Thick styled lines have scrambled patterns). (cmb) . Fixed bug #53640 (XBM images require width to be multiple of 8). (cmb) . Fixed bug #64641 (imagefilledpolygon doesn't draw horizontal line). (cmb) + . Fixed bug #72512 (gdImageTrueColorToPaletteBody allows arbitrary write/read + access). (Pierre) + . Fixed bug #72519 (imagegif/output out-of-bounds access). (Pierre) + . Fixed bug #72558 (Integer overflow error within _gdContributionsAlloc()). + (CVE-2016-6207) (Pierre) + +- Intl: + . Fixed bug #72533 (locale_accept_from_http out-of-bounds access). (Stas) - OpenSSL: . Fixed bug #71915 (openssl_random_pseudo_bytes is not fork-safe). @@ -28,6 +245,10 @@ PHP NEWS . Fixed bug #72336 (openssl_pkey_new does not fail for invalid DSA params). (Jakub Zelenka) +- SNMP: + . Fixed bug #72479 (Use After Free Vulnerability in SNMP with GC and + unserialize()). (taoguangchen at icloud dot com) + - SPL: . Fixed bug #55701 (GlobIterator throws LogicException). (Valentin VĂLCIU) @@ -39,6 +260,14 @@ PHP NEWS . Fixed bug #72439 (Stream socket with remote address leads to a segmentation fault). (Laruence) +- Xmlrpc: + . Fixed bug #72606 (heap-buffer-overflow (write) simplestring_addn simplestring.c). + (Stas) + +- Zip: + . Fixed bug #72520 (Stack-based buffer overflow vulnerability in + php_stream_zip_opener). (loianhtuan at gmail dot com) + 23 Jun 2016, PHP 5.6.23 - Core: @@ -57,7 +286,7 @@ PHP NEWS (cmb) . Fixed bug #72298 (pass2_no_dither out-of-bounds access). (Stas) . Fixed bug #72337 (invalid dimensions can lead to crash). (Pierre) - . Fixed bug #72339 (Integer Overflow in _gd2GetHeader() resulting in + . Fixed bug #72339 (Integer Overflow in _gd2GetHeader() resulting in heap overflow). (CVE-2016-5766) (Pierre) . Fixed bug #72407 (NULL Pointer Dereference at _gdScaleVert). (Stas) . Fixed bug #72446 (Integer Overflow in gdImagePaletteToTrueColor() resulting @@ -131,7 +360,7 @@ PHP NEWS - Curl: . Fixed bug #71831 (CURLOPT_NOPROXY applied as long instead of string). - (Michael Sierks) + (Michael Sierks) - Date: . Fixed bug #71889 (DateInterval::format Segmentation fault). (Thomas Punt) @@ -446,7 +675,7 @@ PHP NEWS a server). (Sergei Turchanov) - OpenSSL: - . Fixed bug #55259 (openssl extension does not get the DH parameters from + . Fixed bug #55259 (openssl extension does not get the DH parameters from DH key resource). (Jakub Zelenka) . Fixed bug #70395 (Missing ARG_INFO for openssl_seal()). (cmb) . Fixed bug #60632 (openssl_seal fails with AES). (Jakub Zelenka) @@ -538,7 +767,7 @@ PHP NEWS - Standard: . Fixed bug #70052 (getimagesize() fails for very large and very small WBMP). (cmb) - . Fixed bug #70157 (parse_ini_string() segmentation fault with + . Fixed bug #70157 (parse_ini_string() segmentation fault with INI_SCANNER_TYPED). (Tjerk) - XSLT: @@ -564,7 +793,7 @@ PHP NEWS - CLI server: . Fixed bug #69655 (php -S changes MKCALENDAR request method to MKCOL). (cmb) . Fixed bug #64878 (304 responses return Content-Type header). (cmb) - + - GD: . Fixed bug #53156 (imagerectangle problem with point ordering). (cmb) . Fixed bug #66387 (Stack overflow with imagefilltoborder). (CVE-2015-8874) @@ -582,7 +811,7 @@ PHP NEWS - ODBC: . Fixed bug #69975 (PHP segfaults when accessing nvarchar(max) defined - columns). (cmb) + columns). (CVE-2015-8879) (cmb) - OpenSSL: . Fixed bug #69882 (OpenSSL error "key values mismatch" after @@ -645,7 +874,7 @@ PHP NEWS - Mysqlnd: . Fixed bug #69669 (mysqlnd is vulnerable to BACKRONYM). (CVE-2015-3152) (Andrey) - + - PCRE: . Fixed Bug #53823 (preg_replace: * qualifier on unicode replace garbles the string). (cmb) @@ -738,7 +967,7 @@ PHP NEWS 14 May 2015, PHP 5.6.9 - Core: - . Fixed bug #69467 (Wrong checked for the interface by using Trait). + . Fixed bug #69467 (Wrong checked for the interface by using Trait). (Laruence) . Fixed bug #69420 (Invalid read in zend_std_get_method). (Laruence) . Fixed bug #60022 ("use statement [...] has no effect" depends on leading @@ -859,7 +1088,7 @@ PHP NEWS (Mike) . Fixed bug #64931 (phar_add_file is too restrictive on filename). (Mike) . Fixed bug #65467 (Call to undefined method cli_arg_typ_string). (Mike) - . Fixed bug #67761 (Phar::mapPhar fails for Phars inside a path containing + . Fixed bug #67761 (Phar::mapPhar fails for Phars inside a path containing ".tar"). (Mike) . Fixed bug #69324 (Buffer Over-read in unserialize when parsing Phar). (Stas) . Fixed bug #69441 (Buffer Overflow when parsing tar/zip/phar in @@ -871,7 +1100,7 @@ PHP NEWS - SOAP: . Fixed bug #69152 (Type Confusion Infoleak Vulnerability in unserialize() with SoapFault). (Dmitry) - . Fixed bug #69293 (NEW segfault when using SoapClient::__setSoapHeader + . Fixed bug #69293 (NEW segfault when using SoapClient::__setSoapHeader (bisected, regression)). (Laruence) - SPL: @@ -893,7 +1122,7 @@ PHP NEWS (Laruence) . Fixed bug #69121 (Segfault in get_current_user when script owner is not in passwd with ZTS build). (dan at syneto dot net) - . Fixed bug #65593 (Segfault when calling ob_start from output buffering + . Fixed bug #65593 (Segfault when calling ob_start from output buffering callback). (Mike) . Fixed bug #68986 (pointer returned by php_stream_fopen_temporary_file not validated in memory.c). (nayana at ddproperty dot com) @@ -930,7 +1159,7 @@ PHP NEWS . Fixed bug #68964 (Allowed memory size exhausted with odbc_exec). (Anatol) - Opcache: - . Fixed bug #69159 (Opcache causes problem when passing a variable variable + . Fixed bug #69159 (Opcache causes problem when passing a variable variable to a function). (Dmitry, Laruence) . Fixed bug #69125 (Array numeric string as key). (Laruence) . Fixed bug #69038 (switch(SOMECONSTANT) misbehaves). (Laruence) @@ -964,7 +1193,7 @@ PHP NEWS - SPL: . Fixed bug #69108 ("Segmentation fault" when (de)serializing SplObjectStorage). (Laruence) - . Fixed bug #68557 (RecursiveDirectoryIterator::seek(0) broken after + . Fixed bug #68557 (RecursiveDirectoryIterator::seek(0) broken after calling getChildren()). (Julien) - ZIP: @@ -1040,7 +1269,7 @@ PHP NEWS . Fixed bug #68063 (Empty session IDs do still start sessions) (Yasuo) - Sqlite3: - . Fixed bug #68260 (SQLite3Result::fetchArray declares wrong + . Fixed bug #68260 (SQLite3Result::fetchArray declares wrong required_num_args). (Julien) - Standard: @@ -1085,7 +1314,7 @@ PHP NEWS CURLOPT_RETURNTRANSFER isn't set). (Jille Timmermans) - Date: - . Implemented FR #68268 (DatePeriod: Getter for start date, end date and + . Implemented FR #68268 (DatePeriod: Getter for start date, end date and interval). (Marc Bennewitz) - EXIF: @@ -1162,7 +1391,7 @@ PHP NEWS (Adam) . Fixed bug #68104 (Segfault while pre-evaluating a disabled function). (Laruence) - . Fixed bug #68185 ("Inconsistent insteadof definition."- incorrectly + . Fixed bug #68185 ("Inconsistent insteadof definition."- incorrectly triggered). (Julien) . Fixed bug #68355 (Inconsistency in example php.ini comments). (Chris McCafferty) @@ -1209,7 +1438,7 @@ PHP NEWS (Matteo) - Session: - . Fixed bug #68331 (Session custom storage callable functions not being called) + . Fixed bug #68331 (Session custom storage callable functions not being called) (Yasuo Ohgaki) - SOAP: @@ -1234,13 +1463,13 @@ PHP NEWS . Fixed bug #68095 (AddressSanitizer reports a heap buffer overflow in php_getopt()). (Stas) . Fixed bug #68118 ($a->foo .= 'test'; can leave $a->foo undefined). (Nikita) - . Fixed bug #68129 (parse_url() - incomplete support for empty usernames + . Fixed bug #68129 (parse_url() - incomplete support for empty usernames and passwords) (Tjerk) . Fixed bug #68365 (zend_mm_heap corrupted after memory overflow in zend_hash_copy). (Dmitry) - CURL: - . Add CURL_SSLVERSION_TLSv1_0, CURL_SSLVERSION_TLSv1_1, and + . Add CURL_SSLVERSION_TLSv1_0, CURL_SSLVERSION_TLSv1_1, and CURL_SSLVERSION_TLSv1_2 constants if supported by libcurl (Rasmus) - Fileinfo: @@ -1412,7 +1641,7 @@ PHP NEWS . Fixed bug #67250 (iptcparse out-of-bounds read). (Stas) . Fixed bug #67252 (convert_uudecode out-of-bounds read). (Stas) . Fixed bug #67249 (printf out-of-bounds read). (Stas) - . Implemented FR #64744 (Differentiate between member function call on a null + . Implemented FR #64744 (Differentiate between member function call on a null and non-null, non-objects). (Boro Sitnikovski) . Fixed bug #67436 (Autoloader isn't called if two method definitions don't match). (Bob) @@ -1443,7 +1672,7 @@ PHP NEWS (Ralf Lang, Mike) . Reduced POST data memory usage by 200-300%. Changed INI setting always_populate_raw_post_data to throw a deprecation warning when enabling - and to accept -1 for never populating the $HTTP_RAW_POST_DATA global + and to accept -1 for never populating the $HTTP_RAW_POST_DATA global variable, which will be the default in future PHP versions. (Mike) . Implemented dedicated syntax for variadic functions (RFC: https://wiki.php.net/rfc/variadics). (Nikita) @@ -1456,9 +1685,9 @@ PHP NEWS . Allow zero length comparison in substr_compare() (Tjerk) . Fixed bug #60602 (proc_open() changes environment array) (Tjerk) . Fixed bug #61019 (Out of memory on command stream_get_contents). (Mike) - . Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace + . Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace UNIX sockets). (Mike) - . Fixed bug #66182 (exit in stream filter produces segfault). (Mike) + . Fixed bug #66182 (exit in stream filter produces segfault). (Mike) . Fixed bug #66736 (fpassthru broken). (Mike) . Fixed bug #66822 (Cannot use T_POW in const expression) (Tjerk) . Fixed bug #67043 (substr_compare broke by previous change) (Tjerk) @@ -1829,7 +2058,7 @@ PHP NEWS (Matteo) - PDO-ODBC: - . Fixed bug #50444 (PDO-ODBC changes for 64-bit). + . Fixed bug #50444 (PDO-ODBC changes for 64-bit). - PDO_pgsql: . Fixed Bug #42614 (PDO_pgsql: add pg_get_notify support). (Matteo) @@ -1888,7 +2117,7 @@ PHP NEWS - SPL: . Revert fix for bug #67064 (BC issues). (Bob) - . Fixed bug #67539 (ArrayIterator use-after-free due to object change during + . Fixed bug #67539 (ArrayIterator use-after-free due to object change during sorting). (CVE-2014-4698) (research at insighti dot org, Laruence) . Fixed bug #67538 (SPL Iterators use-after-free). (CVE-2014-4670) (Laruence) . Fixed bug #67492 (unserialize() SPL ArrayObject / SPLObjectStorage Type @@ -1917,7 +2146,7 @@ PHP NEWS token). (Ferenc) - XMLReader: - . Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency). + . Fixed bug #55285 (XMLReader::getAttribute/No/Ns methods inconsistency). (Mike) - XSL: @@ -1937,7 +2166,7 @@ PHP NEWS - Zlib: . Fixed bug #67865 (internal corruption phar error). Mike - . Fixed bug #67724 (chained zlib filters silently fail with large amounts of + . Fixed bug #67724 (chained zlib filters silently fail with large amounts of data). (Mike) 21 Aug 2014, PHP 5.5.16 @@ -1962,7 +2191,7 @@ PHP NEWS - Milter: . Fixed bug #67715 (php-milter does not build and crashes randomly). (Mike) - + - Network: . Fixed bug #67717 (segfault in dns_get_record). (CVE-2014-3597) (Remi) @@ -2016,7 +2245,7 @@ PHP NEWS . Fixed bug #67531 (syslog cannot be set in pool configuration). (Remi) - Intl: - . Fixed bug #66921 (Wrong argument type hint for function + . Fixed bug #66921 (Wrong argument type hint for function intltz_from_date_time_zone). (Stas) . Fixed bug #67052 (NumberFormatter::parse() resets LC_NUMERIC setting). (Stas) @@ -2033,7 +2262,7 @@ PHP NEWS . Fixed bug #67587 (Redirection loop on nginx with FPM). (Christian Weiske) - SPL: - . Fixed bug #67539 (ArrayIterator use-after-free due to object change during + . Fixed bug #67539 (ArrayIterator use-after-free due to object change during sorting). (CVE-2014-4698) (research at insighti dot org, Laruence) . Fixed bug #67538 (SPL Iterators use-after-free). (CVE-2014-4670) (Laruence) @@ -2155,9 +2384,9 @@ PHP NEWS 30 Apr 2014, PHP 5.5.12 - Core: . Fixed bug #61019 (Out of memory on command stream_get_contents). (Mike) - . Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace + . Fixed bug #64330 (stream_socket_server() creates wrong Abstract Namespace UNIX sockets). (Mike) - . Fixed bug #66182 (exit in stream filter produces segfault). (Mike) + . Fixed bug #66182 (exit in stream filter produces segfault). (Mike) . Fixed bug #66736 (fpassthru broken). (Mike) . Fixed bug #67024 (getimagesize should recognize BMP files with negative height). (Gabor Buella) @@ -2251,7 +2480,7 @@ PHP NEWS (Nikita) - Intl: - . Fixed bug #66873 (A reproductible crash in UConverter when given invalid + . Fixed bug #66873 (A reproductible crash in UConverter when given invalid encoding) (Stas) - Mail: @@ -2326,7 +2555,7 @@ PHP NEWS (Dmitry) . Fixed bug #66461 (PHP crashes if opcache.interned_strings_buffer=0). (Dmitry) - . Fixed bug #66298 (ext/opcache/Optimizer/zend_optimizer.c has dos-style + . Fixed bug #66298 (ext/opcache/Optimizer/zend_optimizer.c has dos-style ^M as lineend). (Laruence) - PDO_pgsql: @@ -2368,12 +2597,12 @@ spaces) (willfitch, iliaa) . Fixed bug #66218 (zend_register_functions breaks reflection). (Remi) - Date: - . Fixed bug #66060 (Heap buffer over-read in DateInterval) (CVE-2013-6712). + . Fixed bug #66060 (Heap buffer over-read in DateInterval) (CVE-2013-6712). (Remi) . Fixed bug #65768 (DateTimeImmutable::diff does not work). (Nikita Nefedov) - + - DOM: - . Fixed bug #65196 (Passing DOMDocumentFragment to DOMDocument::saveHTML() + . Fixed bug #65196 (Passing DOMDocumentFragment to DOMDocument::saveHTML() Produces invalid Markup). (Mike) - Exif: @@ -2385,9 +2614,9 @@ spaces) (willfitch, iliaa) - GD: . Fixed bug #64405 (Use freetype-config for determining freetype2 dir(s)). (Adam) - + - PDO_odbc: - . Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries). + . Fixed bug #66311 (Stack smashing protection kills PDO/ODBC queries). (michael at orlitzky dot com) - MySQLi: @@ -2424,7 +2653,7 @@ spaces) (willfitch, iliaa) server) - also implements apache_response_headers() (Andrea Faulds) - Core: - . Fixed bug #66094 (unregister_tick_function tries to cast a Closure to a + . Fixed bug #66094 (unregister_tick_function tries to cast a Closure to a string). (Laruence) . Fixed bug #65969 (Chain assignment with T_LIST failure). (Dmitry) @@ -2444,7 +2673,7 @@ spaces) (willfitch, iliaa) 14 Nov 2013, PHP 5.5.6 - Core: - . Fixed bug #65947 (basename is no more working after fgetcsv in certain + . Fixed bug #65947 (basename is no more working after fgetcsv in certain situation). (Laruence) . Improved performance of array_merge() and func_get_args() by eliminating useless copying. (Dmitry) @@ -2475,7 +2704,7 @@ spaces) (willfitch, iliaa) 32 characters). (patch submitted by: michael dot y at zend dot com, Yasuo) - PDO: - . Fixed bug #66033 (Segmentation Fault when constructor of PDO statement + . Fixed bug #66033 (Segmentation Fault when constructor of PDO statement throws an exception). (Laruence) . Fixed bug 65946 (sql_parser permanently converts values bound to strings) @@ -2496,7 +2725,7 @@ spaces) (willfitch, iliaa) - CLI server: . Fixed bug #65633 (built-in server treat some http headers as case-sensitive). (Adam) - . Fixed bug #65818 (Segfault with built-in webserver and chunked transfer + . Fixed bug #65818 (Segfault with built-in webserver and chunked transfer encoding). (Felipe) . Added application/pdf to PHP CLI Web Server mime types (Chris Jones) @@ -2549,17 +2778,17 @@ spaces) (willfitch, iliaa) a default value). (Nikita) - Standard: - . Fixed bug #61548 (content-type must appear at the end of headers for 201 + . Fixed bug #61548 (content-type must appear at the end of headers for 201 Location to work in http). (Mike) - XMLReader: . Fixed bug #51936 (Crash with clone XMLReader). (Mike) . Fixed bug #64230 (XMLReader does not suppress errors). (Mike) - + - Build system: . Fixed bug #51076 (race condition in shtool's mkdir -p implementation). (Mike, Raphael Geissert) - . Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing + . Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing gzencode())). (Mike) @@ -2569,7 +2798,7 @@ spaces) (willfitch, iliaa) . Fixed bug #60598 (cli/apache sapi segfault on objects manipulation). (Laruence) . Improved fputcsv() to allow specifying escape character. - . Fixed bug #65490 (Duplicate calls to get lineno & filename for + . Fixed bug #65490 (Duplicate calls to get lineno & filename for DTRACE_FUNCTION_*). (Chris Jones) . Fixed bug #65483 (quoted-printable encode stream filter incorrectly encoding spaces). (Michael M Slusarz) @@ -2601,21 +2830,21 @@ spaces) (willfitch, iliaa) some cases). (Mark Jones) - PDO: - . Fixed bug #64953 (Postgres prepared statement positional parameter + . Fixed bug #64953 (Postgres prepared statement positional parameter casting). (Mike) - Session: . Fixed bug #65475 (Session ID is not initialized properly when strict session is enabled). (Yasuo) - . Fixed bug #51127/#65359 Request #25630/#43980/#54383 (Added php_serialize + . Fixed bug #51127/#65359 Request #25630/#43980/#54383 (Added php_serialize session serialize handler that uses plain serialize()). (Yasuo) - Standard: . Fix issue with return types of password API helper functions. Found via - static analysis by cjones. (Anthony Ferrara) + static analysis by cjones. (Anthony Ferrara) - Zlib: - . Fixed bug #65391 (Unable to send vary header user-agent when + . Fixed bug #65391 (Unable to send vary header user-agent when ob_start('ob_gzhandler') is called) (Mike) 22 Aug 2013, PHP 5.5.3 @@ -2640,8 +2869,8 @@ spaces) (willfitch, iliaa) Zend/zend_dtrace.d) (Chris Jones) - DOM: - . Added flags option to DOMDocument::schemaValidate() and - DOMDocument::schemaValidateSource(). Added LIBXML_SCHEMA_CREATE flag. + . Added flags option to DOMDocument::schemaValidate() and + DOMDocument::schemaValidateSource(). Added LIBXML_SCHEMA_CREATE flag. (Chris Wright) - OPcache: @@ -2664,12 +2893,12 @@ spaces) (willfitch, iliaa) /pg_delete()/pg_insert()). (Yasuo) - Phar: - . Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for + . Fixed bug #65028 (Phar::buildFromDirectory creates corrupt archives for some specific contents). (Stas) - Sessions: . Implemented strict sessions RFC (https://wiki.php.net/rfc/strict_sessions) - which protects against session fixation attacks and session collisions. + which protects against session fixation attacks and session collisions. (CVE-2011-4718). (Yasuo Ohgaki) . Fixed possible buffer overflow under Windows. Note: Not a security fix. (Yasuo) @@ -2680,9 +2909,9 @@ spaces) (willfitch, iliaa) - SPL: . Fixed bug #65328 (Segfault when getting SplStack object Value). (Laruence) - . Added RecursiveTreeIterator setPostfix and getPostifx methods. (Joshua + . Added RecursiveTreeIterator setPostfix and getPostifx methods. (Joshua Thijssen) - . Fixed bug #61697 (spl_autoload_functions returns lambda functions + . Fixed bug #61697 (spl_autoload_functions returns lambda functions incorrectly). (Laruence) - Streams: @@ -2699,7 +2928,7 @@ spaces) (willfitch, iliaa) with a namespace). (Laruence) . Fixed bug #65088 (Generated configure script is malformed on OpenBSD). (Adam) - . Fixed bug #65108 (is_callable() triggers Fatal Error). + . Fixed bug #65108 (is_callable() triggers Fatal Error). (David Soria Parra, Laruence) . Fixed bug #65035 (yield / exit segfault). (Nikita) . Fixed bug #65161 (Generator + autoload + syntax error = segfault). (Nikita) @@ -3117,7 +3346,7 @@ spaces) (willfitch, iliaa) . Fixed bug #63284 (Upgrade PCRE to 8.31). (Anatoliy) - PDO: - . Fixed bug #63176 (Segmentation fault when instantiate 2 persistent PDO to + . Fixed bug #63176 (Segmentation fault when instantiate 2 persistent PDO to the same db server). (Laruence) - PDO_DBlib: @@ -3203,7 +3432,7 @@ spaces) (willfitch, iliaa) 06 Jun 2013, PHP 5.4.16 - Core: - . Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode, + . Fixed bug #64879 (Heap based buffer overflow in quoted_printable_encode, CVE 2013-2110). (Stas) . Fixed bug #64853 (Use of no longer available ini directives causes crash on TS build). (Anatol) @@ -3232,7 +3461,7 @@ spaces) (willfitch, iliaa) pointer has closed). (Laruence) - Phar - . Fixed bug #64214 (PHAR PHPTs intermittently crash when run on DFS, SMB or + . Fixed bug #64214 (PHAR PHPTs intermittently crash when run on DFS, SMB or with non std tmp dir). (Pierre) - SNMP: @@ -3245,7 +3474,7 @@ spaces) (willfitch, iliaa) on Windows x64). (Anatol) - Zend Engine: - . Fixed bug #64821 (Custom Exceptions crash when internal properties + . Fixed bug #64821 (Custom Exceptions crash when internal properties overridden). (Anatol) 09 May 2013, PHP 5.4.15 diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 06e4561f9297a..0fec4a0e9a359 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -616,6 +616,12 @@ TSRM_API int shmget(int key, int size, int flags) } } else { if (flags & IPC_EXCL) { + if (shm_handle) { + CloseHandle(shm_handle); + } + if (info_handle) { + CloseHandle(info_handle); + } return -1; } } @@ -654,17 +660,27 @@ TSRM_API int shmget(int key, int size, int flags) TSRM_API void *shmat(int key, const void *shmaddr, int flags) { shm_pair *shm = shm_get(key, NULL); + int err; if (!shm->segment) { return (void*)-1; } + shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); + + err = GetLastError(); + if (err) { + /* Catch more errors */ + if (ERROR_NOT_ENOUGH_MEMORY == err) { + _set_errno(ENOMEM); + } + return (void*)-1; + } + shm->descriptor->shm_atime = time(NULL); shm->descriptor->shm_lpid = getpid(); shm->descriptor->shm_nattch++; - shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); - return shm->addr; } diff --git a/UPGRADING b/UPGRADING index e2cf5a747876d..353ffa73ad039 100644 --- a/UPGRADING +++ b/UPGRADING @@ -218,6 +218,9 @@ PHP 5.6 UPGRADE NOTES . CURLOPT_KRBLEVEL . CURLOPT_KRB4LEVEL + curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer + as a string (PHP >= 5.6.25) + - Strings: substr_compare() now allows $length to be zero. pack() and unpack() now support 64-bit format specifiers: q, Q, J and P. @@ -400,6 +403,9 @@ PHP 5.6 UPGRADE NOTES - CURL: CURL_HTTP_VERSION_2_0 and CURL_VERSION_HTTP2 (>= 5.6.8) +- GD: + IMG_WEBP (>= 5.6.25) + - LDAP: LDAP_ESCAPE_FILTER int(1) LDAP_ESCAPE_DN int(2) diff --git a/Zend/tests/bug72907.phpt b/Zend/tests/bug72907.phpt new file mode 100644 index 0000000000000..00d9f5d183172 --- /dev/null +++ b/Zend/tests/bug72907.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer (zend_gc.c:260)) +--FILE-- +a = &$E) + ($b = $a->b->i -= 0); + +?> +--EXPECTF-- +Warning: Attempt to modify property of non-object in %sbug72907.php on line %d + +Warning: Attempt to modify property of non-object in %sbug72907.php on line %d + +Warning: Creating default object from empty value in %sbug72907.php on line %d + +Notice: Undefined property: stdClass::$i in %sbug72907.php on line %d diff --git a/Zend/zend_API.h b/Zend/zend_API.h index a56075e177bdf..e17be4ce681d0 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -447,7 +447,7 @@ ZEND_API int add_property_zval_ex(zval *arg, const char *key, uint key_len, zval #define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC) #define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC) #define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC) -#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC) +#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC) ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, zend_uint param_count, zval *params[] TSRMLS_DC); @@ -458,7 +458,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache; /** Build zend_call_info/cache from a zval* * - * Caller is responsible to provide a return value, otherwise the we will crash. + * Caller is responsible to provide a return value, otherwise the we will crash. * fci->retval_ptr_ptr = NULL; * In order to pass parameters the following members need to be set: * fci->param_count = 0; @@ -578,6 +578,9 @@ END_EXTERN_C() const char *__s=(s); \ zval *__z = (z); \ Z_STRLEN_P(__z) = strlen(__s); \ + if (UNEXPECTED(Z_STRLEN_P(__z) < 0)) { \ + zend_error(E_ERROR, "String size overflow"); \ + } \ Z_STRVAL_P(__z) = (duplicate?estrndup(__s, Z_STRLEN_P(__z)):(char*)__s);\ Z_TYPE_P(__z) = IS_STRING; \ } while (0) diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c index 66476a15172fc..fda4d21e032bf 100644 --- a/Zend/zend_exceptions.c +++ b/Zend/zend_exceptions.c @@ -230,7 +230,7 @@ ZEND_METHOD(exception, __construct) Exception unserialize checks */ #define CHECK_EXC_TYPE(name, type) \ value = zend_read_property(default_exception_ce, object, name, sizeof(name)-1, 0 TSRMLS_CC); \ - if(value && Z_TYPE_P(value) != type) { \ + if (value && Z_TYPE_P(value) != IS_NULL && Z_TYPE_P(value) != type) { \ zval *tmp; \ MAKE_STD_ZVAL(tmp); \ ZVAL_STRINGL(tmp, name, sizeof(name)-1, 1); \ diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index c7e4b926d8ceb..b422624bb19be 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -522,9 +522,7 @@ static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **va zval *variable_ptr = *variable_ptr_ptr; zval *value_ptr = *value_ptr_ptr; - if (variable_ptr == &EG(error_zval) || value_ptr == &EG(error_zval)) { - variable_ptr_ptr = &EG(uninitialized_zval_ptr); - } else if (variable_ptr != value_ptr) { + if (variable_ptr != value_ptr) { if (!PZVAL_IS_REF(value_ptr)) { /* break it away */ Z_DELREF_P(value_ptr); diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index c8e42ddc60bae..5a5bccecabf88 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -651,14 +651,14 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{ memcmp(path, (*bucket)->path, path_len) == 0) { realpath_cache_bucket *r = *bucket; *bucket = (*bucket)->next; - + /* if the pointers match then only subtract the length of the path */ if(r->path == r->realpath) { CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1; } else { CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1; } - + free(r); return; } else { @@ -734,7 +734,7 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p realpath_cache_bucket *r = *bucket; *bucket = (*bucket)->next; - /* if the pointers match then only subtract the length of the path */ + /* if the pointers match then only subtract the length of the path */ if(r->path == r->realpath) { CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1; } else { @@ -1190,7 +1190,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func int add_slash; void *tmp; - if (path_length == 0 || path_length >= MAXPATHLEN-1) { + if (path_length <= 0 || path_length >= MAXPATHLEN-1) { #ifdef TSRM_WIN32 # if _MSC_VER < 1300 errno = EINVAL; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 2e81f82e4989a..f79d8a3f9eb4a 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1817,11 +1817,14 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV) if ((OP2_TYPE == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) || (OP1_TYPE == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); - } - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - Z_DELREF_PP(variable_ptr_ptr); + } else if ((OP2_TYPE == IS_VAR && UNEXPECTED(*value_ptr_ptr == &EG(error_zval))) || + (OP1_TYPE == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval)))) { + variable_ptr_ptr = &EG(uninitialized_zval_ptr); + } else { + zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); + if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { + Z_DELREF_PP(variable_ptr_ptr); + } } if (RETURN_VALUE_USED(opline)) { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index df47bea982f43..a31027ee925b8 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -20408,11 +20408,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) || (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); - } - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - Z_DELREF_PP(variable_ptr_ptr); + } else if ((IS_VAR == IS_VAR && UNEXPECTED(*value_ptr_ptr == &EG(error_zval))) || + (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval)))) { + variable_ptr_ptr = &EG(uninitialized_zval_ptr); + } else { + zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); + if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { + Z_DELREF_PP(variable_ptr_ptr); + } } if (RETURN_VALUE_USED(opline)) { @@ -23903,11 +23906,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) || (IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); - } - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - Z_DELREF_PP(variable_ptr_ptr); + } else if ((IS_CV == IS_VAR && UNEXPECTED(*value_ptr_ptr == &EG(error_zval))) || + (IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval)))) { + variable_ptr_ptr = &EG(uninitialized_zval_ptr); + } else { + zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); + if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { + Z_DELREF_PP(variable_ptr_ptr); + } } if (RETURN_VALUE_USED(opline)) { @@ -37721,11 +37727,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) || (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); - } - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - Z_DELREF_PP(variable_ptr_ptr); + } else if ((IS_VAR == IS_VAR && UNEXPECTED(*value_ptr_ptr == &EG(error_zval))) || + (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval)))) { + variable_ptr_ptr = &EG(uninitialized_zval_ptr); + } else { + zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); + if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { + Z_DELREF_PP(variable_ptr_ptr); + } } if (RETURN_VALUE_USED(opline)) { @@ -40929,11 +40938,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) || (IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) { zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects"); - } - zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); - - if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { - Z_DELREF_PP(variable_ptr_ptr); + } else if ((IS_CV == IS_VAR && UNEXPECTED(*value_ptr_ptr == &EG(error_zval))) || + (IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval)))) { + variable_ptr_ptr = &EG(uninitialized_zval_ptr); + } else { + zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC); + if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) { + Z_DELREF_PP(variable_ptr_ptr); + } } if (RETURN_VALUE_USED(opline)) { diff --git a/configure.in b/configure.in index d3b20561de17d..be79a02231d85 100644 --- a/configure.in +++ b/configure.in @@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...); PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=6 -PHP_RELEASE_VERSION=24 -PHP_EXTRA_VERSION="RC1" +PHP_RELEASE_VERSION=26 +PHP_EXTRA_VERSION="-dev" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index a93493fd3eb0d..79ec3ec3fedf1 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -15,7 +15,7 @@ | Author: Sterling Hughes | +----------------------------------------------------------------------+ */ - + /* $Id$ */ #ifdef HAVE_CONFIG_H @@ -138,29 +138,33 @@ 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; - - ret = BZ2_bzread(self->bz_file, buf, count); + int bz2_ret; + + bz2_ret = BZ2_bzread(self->bz_file, buf, count); - if (ret == 0) { + if (bz2_ret < 0) { + stream->eof = 1; + return -1; + } + if (bz2_ret == 0) { stream->eof = 1; } - return ret; + return (size_t)bz2_ret; } static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count TSRMLS_DC) { struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) stream->abstract; - return BZ2_bzwrite(self->bz_file, (char*)buf, count); + return BZ2_bzwrite(self->bz_file, (char*)buf, count); } static int php_bz2iop_close(php_stream *stream, int close_handle TSRMLS_DC) { struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *)stream->abstract; int ret = EOF; - + if (close_handle) { BZ2_bzclose(self->bz_file); } @@ -192,11 +196,11 @@ php_stream_ops php_stream_bz2io_ops = { }; /* {{{ Bzip2 stream openers */ -PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, +PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, const char *mode, php_stream *innerstream STREAMS_DC TSRMLS_DC) { struct php_bz2_stream_data_t *self; - + self = emalloc(sizeof(*self)); self->stream = innerstream; @@ -227,7 +231,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, virtual_filepath_ex(path, &path_copy, NULL TSRMLS_CC); #else path_copy = path; -#endif +#endif if (php_check_open_basedir(path_copy TSRMLS_CC)) { #ifdef VIRTUAL_DIR @@ -235,7 +239,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, #endif return NULL; } - + /* try and open it directly first */ bz_file = BZ2_bzopen(path_copy, mode); @@ -246,11 +250,11 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, efree(path_copy); #endif path_copy = NULL; - + if (bz_file == NULL) { /* that didn't work, so try and get something from the network/wrapper */ stream = php_stream_open_wrapper(path, mode, options | STREAM_WILL_CAST, opened_path); - + if (stream) { php_socket_t fd; if (SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD, (void **) &fd, REPORT_ERRORS)) { @@ -265,7 +269,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open(php_stream_wrapper *wrapper, VCWD_UNLINK(*opened_path); } } - + if (bz_file) { retstream = _php_stream_bz2open_from_BZFILE(bz_file, mode, stream STREAMS_REL_CC TSRMLS_CC); if (retstream) { @@ -341,7 +345,7 @@ static PHP_FUNCTION(bzread) if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &bz, &len)) { RETURN_FALSE; } - + php_stream_from_zval(stream, &bz); if ((len + 1) < 1) { @@ -351,13 +355,13 @@ static PHP_FUNCTION(bzread) Z_STRVAL_P(return_value) = emalloc(len + 1); Z_STRLEN_P(return_value) = php_stream_read(stream, Z_STRVAL_P(return_value), len); - + if (Z_STRLEN_P(return_value) < 0) { efree(Z_STRVAL_P(return_value)); php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not read valid bz2 data from stream"); - RETURN_FALSE; + RETURN_FALSE; } - + Z_STRVAL_P(return_value)[Z_STRLEN_P(return_value)] = 0; Z_TYPE_P(return_value) = IS_STRING; } @@ -373,7 +377,7 @@ static PHP_FUNCTION(bzopen) BZFILE *bz; /* The compressed file stream */ php_stream *stream = NULL; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Zs", &file, &mode, &mode_len) == FAILURE) { return; } @@ -389,15 +393,15 @@ static PHP_FUNCTION(bzopen) php_error_docref(NULL TSRMLS_CC, E_WARNING, "filename cannot be empty"); RETURN_FALSE; } - + if (CHECK_ZVAL_NULL_PATH(*file)) { RETURN_FALSE; } stream = php_stream_bz2open(NULL, - Z_STRVAL_PP(file), - mode, - REPORT_ERRORS, + Z_STRVAL_PP(file), + mode, + REPORT_ERRORS, NULL); } else if (Z_TYPE_PP(file) == IS_RESOURCE) { /* If it is a resource, than its a stream resource */ @@ -406,7 +410,7 @@ static PHP_FUNCTION(bzopen) php_stream_from_zval(stream, file); stream_mode_len = strlen(stream->mode); - + if (stream_mode_len != 1 && !(stream_mode_len == 2 && memchr(stream->mode, 'b', 2))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode); RETURN_FALSE; @@ -440,7 +444,7 @@ static PHP_FUNCTION(bzopen) if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_FD, (void *) &fd, REPORT_ERRORS)) { RETURN_FALSE; } - + bz = BZ2_bzdopen(fd, mode); stream = php_stream_bz2open_from_BZFILE(bz, mode, stream); @@ -494,7 +498,7 @@ static PHP_FUNCTION(bzcompress) work_factor = 0, /* Work factor for compression algorithm */ argc; /* Argument count */ int source_len; /* Length of the source data */ - unsigned int dest_len; /* Length of the destination buffer */ + unsigned int dest_len; /* Length of the destination buffer */ argc = ZEND_NUM_ARGS(); @@ -503,19 +507,19 @@ static PHP_FUNCTION(bzcompress) } /* Assign them to easy to use variables, dest_len is initially the length of the data - + .01 x length of data + 600 which is the largest size the results of the compression - could possibly be, at least that's what the libbz2 docs say (thanks to jeremy@nirvani.net + + .01 x length of data + 600 which is the largest size the results of the compression + could possibly be, at least that's what the libbz2 docs say (thanks to jeremy@nirvani.net for pointing this out). */ dest_len = (unsigned int) (source_len + (0.01 * source_len) + 600); - + /* Allocate the destination buffer */ dest = emalloc(dest_len + 1); - + /* Handle the optional arguments */ if (argc > 1) { block_size = zblock_size; } - + if (argc > 2) { work_factor = zwork_factor; } @@ -565,20 +569,30 @@ static PHP_FUNCTION(bzdecompress) /* in most cases bz2 offers at least 2:1 compression, so we use that as our base */ bzs.avail_out = source_len * 2; bzs.next_out = dest = emalloc(bzs.avail_out + 1); - + while ((error = BZ2_bzDecompress(&bzs)) == BZ_OK && bzs.avail_in > 0) { /* compression is better then 2:1, need to allocate more memory */ bzs.avail_out = source_len; size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32; + if (size > INT_MAX) { + /* no reason to continue if we're going to drop it anyway */ + break; + } dest = safe_erealloc(dest, 1, bzs.avail_out+1, (size_t) size ); bzs.next_out = dest + size; } if (error == BZ_STREAM_END || error == BZ_OK) { size = (bzs.total_out_hi32 * (unsigned int) -1) + bzs.total_out_lo32; - dest = safe_erealloc(dest, 1, (size_t) size, 1); - dest[size] = '\0'; - RETVAL_STRINGL(dest, (int) size, 0); + if (size > INT_MAX) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Decompressed size too big, max is %d", INT_MAX); + efree(dest); + RETVAL_LONG(BZ_MEM_ERROR); + } else { + dest = safe_erealloc(dest, 1, (size_t) size, 1); + dest[size] = '\0'; + RETVAL_STRINGL(dest, (int) size, 0); + } } else { /* real error */ efree(dest); RETVAL_LONG(error); @@ -591,13 +605,13 @@ static PHP_FUNCTION(bzdecompress) /* {{{ php_bz2_error() The central error handling interface, does the work for bzerrno, bzerrstr and bzerror */ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt) -{ +{ zval *bzp; /* BZip2 Resource Pointer */ php_stream *stream; const char *errstr; /* Error string */ int errnum; /* Error number */ struct php_bz2_stream_data_t *self; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &bzp) == FAILURE) { return; } @@ -609,10 +623,10 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt) } self = (struct php_bz2_stream_data_t *) stream->abstract; - + /* Fetch the error information */ errstr = BZ2_bzerror(self->bz_file, &errnum); - + /* Determine what to return */ switch (opt) { case PHP_BZ_ERRNO: @@ -623,7 +637,7 @@ static void php_bz2_error(INTERNAL_FUNCTION_PARAMETERS, int opt) break; case PHP_BZ_ERRBOTH: array_init(return_value); - + add_assoc_long (return_value, "errno", errnum); add_assoc_string(return_value, "errstr", (char*)errstr, 1); break; diff --git a/ext/bz2/tests/72613.bz2 b/ext/bz2/tests/72613.bz2 new file mode 100644 index 0000000000000..0b932f8d91258 Binary files /dev/null and b/ext/bz2/tests/72613.bz2 differ diff --git a/ext/bz2/tests/bug72613.phpt b/ext/bz2/tests/bug72613.phpt new file mode 100644 index 0000000000000..82547e6ae071c --- /dev/null +++ b/ext/bz2/tests/bug72613.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #72613 (Inadequate error handling in bzread()) +--SKIPIF-- + +--FILE-- + +DONE +--EXPECT-- +DONE \ No newline at end of file diff --git a/ext/calendar/calendar.c b/ext/calendar/calendar.c index 74478e8b93327..fd487607ba04a 100644 --- a/ext/calendar/calendar.c +++ b/ext/calendar/calendar.c @@ -359,6 +359,10 @@ PHP_FUNCTION(cal_days_in_month) } else { sdn_next = calendar->to_jd(year + 1, 1, 1); + if (cal == CAL_FRENCH && sdn_next == 0) { + /* The French calendar ends on 0014-13-05. */ + sdn_next = 2380953; + } } } @@ -416,15 +420,21 @@ PHP_FUNCTION(cal_from_jd) add_assoc_long(return_value, "year", year); /* day of week */ - dow = DayOfWeek(jd); - add_assoc_long(return_value, "dow", dow); - add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow], 1); - add_assoc_string(return_value, "dayname", DayNameLong[dow], 1); + if (cal != CAL_JEWISH || year > 0) { + dow = DayOfWeek(jd); + add_assoc_long(return_value, "dow", dow); + add_assoc_string(return_value, "abbrevdayname", DayNameShort[dow], 1); + add_assoc_string(return_value, "dayname", DayNameLong[dow], 1); + } else { + add_assoc_null(return_value, "dow"); + add_assoc_string(return_value, "abbrevdayname", "", 1); + add_assoc_string(return_value, "dayname", "", 1); + } /* month name */ if(cal == CAL_JEWISH) { /* special case for Jewish calendar */ - add_assoc_string(return_value, "abbrevmonth", JEWISH_MONTH_NAME(year)[month], 1); - add_assoc_string(return_value, "monthname", JEWISH_MONTH_NAME(year)[month], 1); + add_assoc_string(return_value, "abbrevmonth", (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""), 1); + add_assoc_string(return_value, "monthname", (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""), 1); } else { add_assoc_string(return_value, "abbrevmonth", calendar->month_name_short[month], 1); add_assoc_string(return_value, "monthname", calendar->month_name_long[month], 1); @@ -737,7 +747,7 @@ PHP_FUNCTION(jdmonthname) break; case CAL_MONTH_JEWISH: /* jewish month */ SdnToJewish(julday, &year, &month, &day); - monthname = JEWISH_MONTH_NAME(year)[month]; + monthname = (year > 0 ? JEWISH_MONTH_NAME(year)[month] : ""); break; case CAL_MONTH_FRENCH: /* french month */ SdnToFrench(julday, &year, &month, &day); diff --git a/ext/calendar/tests/bug67976.phpt b/ext/calendar/tests/bug67976.phpt new file mode 100644 index 0000000000000..74e0bc81b1948 --- /dev/null +++ b/ext/calendar/tests/bug67976.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #67976 (cal_days_month() fails for final month of the French calendar) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +int(5) diff --git a/ext/calendar/tests/bug71894.phpt b/ext/calendar/tests/bug71894.phpt new file mode 100644 index 0000000000000..ea2d6004e727c --- /dev/null +++ b/ext/calendar/tests/bug71894.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #71894 (AddressSanitizer: global-buffer-overflow in zif_cal_from_jd) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(9) { + ["date"]=> + string(5) "0/0/0" + ["month"]=> + int(0) + ["day"]=> + int(0) + ["year"]=> + int(0) + ["dow"]=> + NULL + ["abbrevdayname"]=> + string(0) "" + ["dayname"]=> + string(0) "" + ["abbrevmonth"]=> + string(0) "" + ["monthname"]=> + string(0) "" +} +string(0) "" diff --git a/ext/calendar/tests/jdtogregorian_overflow.phpt b/ext/calendar/tests/jdtogregorian_overflow.phpt new file mode 100644 index 0000000000000..28f5298e19b32 --- /dev/null +++ b/ext/calendar/tests/jdtogregorian_overflow.phpt @@ -0,0 +1,28 @@ +--TEST-- +jdtogregorian(): test overflow +--CREDITS-- +neweracracker@gmail.com +--SKIPIF-- + +--FILE-- + +--EXPECT-- +536838860:10/11/1465102 +536838861:10/12/1465102 +536838862:10/13/1465102 +536838863:10/14/1465102 +536838864:10/15/1465102 +536838865:10/16/1465102 +536838866:10/17/1465102 +536838867:0/0/0 +536838868:0/0/0 +536838869:0/0/0 +DONE diff --git a/ext/calendar/tests/jdtojewish_overflow.phpt b/ext/calendar/tests/jdtojewish_overflow.phpt new file mode 100644 index 0000000000000..1d1c2eefb9111 --- /dev/null +++ b/ext/calendar/tests/jdtojewish_overflow.phpt @@ -0,0 +1,27 @@ +--TEST-- +jdtojewish(): test overflow +--CREDITS-- +neweracracker@gmail.com +--SKIPIF-- + +--FILE-- + +--EXPECT-- +324542840:12/7/887605 +324542841:12/8/887605 +324542842:12/9/887605 +324542843:12/10/887605 +324542844:12/11/887605 +324542845:12/12/887605 +324542846:12/13/887605 +324542847:0/0/0 +324542848:0/0/0 +324542849:0/0/0 +DONE diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 19d8bb02b5899..02fbec777682f 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1833,38 +1833,6 @@ static void alloc_curl_handle(php_curl **ch) /* }}} */ #if LIBCURL_VERSION_NUM >= 0x071301 /* Available since 7.19.1 */ -/* {{{ split_certinfo - */ -static void split_certinfo(char *string, zval *hash) -{ - char *org = estrdup(string); - char *s = org; - char *split; - - if(org) { - do { - char *key; - char *val; - char *tmp; - - split = strstr(s, "; "); - if(split) - *split = '\0'; - - key = s; - tmp = memchr(key, '=', 64); - if(tmp) { - *tmp = '\0'; - val = tmp+1; - add_assoc_string(hash, key, val, 1); - } - s = split+2; - } while(split); - efree(org); - } -} -/* }}} */ - /* {{{ create_certinfo */ static void create_certinfo(struct curl_certinfo *ci, zval *listcode TSRMLS_DC) @@ -1883,22 +1851,13 @@ static void create_certinfo(struct curl_certinfo *ci, zval *listcode TSRMLS_DC) int len; char s[64]; char *tmp; - strncpy(s, slist->data, 64); - tmp = memchr(s, ':', 64); + strncpy(s, slist->data, sizeof(s)); + s[sizeof(s)-1] = '\0'; + tmp = memchr(s, ':', sizeof(s)); if(tmp) { *tmp = '\0'; len = strlen(s); - if(!strcmp(s, "Subject") || !strcmp(s, "Issuer")) { - zval *hash; - - MAKE_STD_ZVAL(hash); - array_init(hash); - - split_certinfo(&slist->data[len+1], hash); - add_assoc_zval(certhash, s, hash); - } else { - add_assoc_string(certhash, s, &slist->data[len+1], 1); - } + add_assoc_string(certhash, s, &slist->data[len+1], 1); } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not extract hash key from certificate info"); } @@ -1925,7 +1884,9 @@ static void _php_curl_set_default_options(php_curl *ch) curl_easy_setopt(ch->cp, CURLOPT_INFILE, (void *) ch); curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_header); curl_easy_setopt(ch->cp, CURLOPT_WRITEHEADER, (void *) ch); +#if !defined(ZTS) curl_easy_setopt(ch->cp, CURLOPT_DNS_USE_GLOBAL_CACHE, 1); +#endif curl_easy_setopt(ch->cp, CURLOPT_DNS_CACHE_TIMEOUT, 120); curl_easy_setopt(ch->cp, CURLOPT_MAXREDIRS, 20); /* prevent infinite redirects */ @@ -2263,7 +2224,14 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue TSRMLS_DC) return 1; } #endif +# if defined(ZTS) + if (option == CURLOPT_DNS_USE_GLOBAL_CACHE) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled"); + return 1; + } +# endif error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); + break; case CURLOPT_SAFE_UPLOAD: convert_to_long_ex(zvalue); @@ -2547,12 +2515,13 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue TSRMLS_DC) } } - if (Z_REFCOUNT_P(ch->clone) <= 1) { - zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL); - } else { - zend_hash_next_index_insert(ch->to_free->slist, &slist, sizeof(struct curl_slist *), NULL); + if (slist) { + if (Z_REFCOUNT_P(ch->clone) <= 1) { + zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL); + } else { + zend_hash_next_index_insert(ch->to_free->slist, &slist, sizeof(struct curl_slist *), NULL); + } } - error = curl_easy_setopt(ch->cp, option, slist); break; @@ -3510,6 +3479,10 @@ PHP_FUNCTION(curl_escape) ZEND_FETCH_RESOURCE(ch, php_curl *, &zid, -1, le_curl_name, le_curl); if ((res = curl_easy_escape(ch->cp, str, str_len))) { + if (strlen(res) > INT_MAX) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Escaped string is too long, maximum is %d", INT_MAX); + RETURN_FALSE; + } RETVAL_STRING(res, 1); curl_free(res); } else { diff --git a/ext/curl/tests/bug71144.phpt b/ext/curl/tests/bug71144.phpt new file mode 100644 index 0000000000000..059cd63651f89 --- /dev/null +++ b/ext/curl/tests/bug71144.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #71144 (Sementation fault when using cURL with ZTS) +--SKIPIF-- + + +--FILE-- + +--EXPECTF-- +Warning: curl_setopt(): CURLOPT_DNS_USE_GLOBAL_CACHE cannot be activated when thread safety is enabled in %sbug71144.php on line %d +bool(false) diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 80403d02c32ce..e7f7251c6a4e8 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 Thu Aug 13 10:30:11 2015 */ +/* Generated by re2c 0.15.3 on Sun Jul 24 14:49:45 2016 */ #line 1 "ext/date/lib/parse_date.re" /* * The MIT License (MIT) @@ -824,7 +824,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) -#line 828 "ext/date/lib/parse_date.c" +#line 828 "" { YYCTYPE yych; unsigned int yyaccept = 0; @@ -862,11 +862,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - - YYDEBUG(0, *YYCURSOR); if ((YYLIMIT - YYCURSOR) < 31) YYFILL(31); yych = *YYCURSOR; - YYDEBUG(-1, yych); switch (yych) { case 0x00: case '\n': goto yy51; @@ -943,7 +940,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy53; } yy2: - YYDEBUG(2, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= 'E') { if (yych <= ')') { @@ -963,7 +959,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy3: - YYDEBUG(3, *YYCURSOR); #line 1626 "ext/date/lib/parse_date.re" { int tz_not_found; @@ -977,9 +972,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIMEZONE; } -#line 981 "ext/date/lib/parse_date.c" +#line 976 "" yy4: - YYDEBUG(4, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -1002,7 +996,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy5: - YYDEBUG(5, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'D') { @@ -1040,7 +1033,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy6: - YYDEBUG(6, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'D') { @@ -1078,7 +1070,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy7: - YYDEBUG(7, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'A') { @@ -1108,7 +1099,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy8: - YYDEBUG(8, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'A') { @@ -1138,10 +1128,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy9: - YYDEBUG(9, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case ')': goto yy139; case '0': @@ -1209,10 +1197,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy3; } yy10: - YYDEBUG(10, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case ')': goto yy139; case '0': @@ -1280,22 +1266,19 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy3; } yy11: - YYDEBUG(11, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yych == '-') goto yy1384; if (yych <= '/') goto yy12; if (yych <= '9') goto yy1385; yy12: - YYDEBUG(12, *YYCURSOR); #line 1721 "ext/date/lib/parse_date.re" { add_error(s, "Unexpected character"); goto std; } -#line 1297 "ext/date/lib/parse_date.c" +#line 1281 "" yy13: - YYDEBUG(13, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= 'E') { @@ -1340,7 +1323,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy14: - YYDEBUG(14, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= 'E') { @@ -1385,7 +1367,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy15: - YYDEBUG(15, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -1402,7 +1383,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy16: - YYDEBUG(16, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -1419,7 +1399,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy17: - YYDEBUG(17, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -1436,7 +1415,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy18: - YYDEBUG(18, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -1453,7 +1431,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy19: - YYDEBUG(19, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'D') { @@ -1497,7 +1474,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy20: - YYDEBUG(20, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'D') { @@ -1541,7 +1517,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy21: - YYDEBUG(21, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych <= '@') { @@ -1565,7 +1540,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy22: - YYDEBUG(22, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych <= '@') { @@ -1589,7 +1563,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy23: - YYDEBUG(23, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= ')') { @@ -1612,7 +1585,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy24: - YYDEBUG(24, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= ')') { @@ -1635,10 +1607,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy25: - YYDEBUG(25, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': goto yy1051; case ' ': @@ -1687,10 +1657,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy12; } yy26: - YYDEBUG(26, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': goto yy459; case ' ': @@ -1741,10 +1709,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy12; } yy27: - YYDEBUG(27, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': goto yy459; case ' ': @@ -1795,10 +1761,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy12; } yy28: - YYDEBUG(28, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': goto yy459; case ' ': @@ -1849,10 +1813,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy12; } yy29: - YYDEBUG(29, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': goto yy459; case ' ': @@ -1903,13 +1865,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy12; } yy30: - YYDEBUG(30, *YYCURSOR); yyaccept = 1; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { goto yy57; } - YYDEBUG(-1, yych); switch (yych) { case '+': case '-': goto yy439; @@ -1926,7 +1886,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy12; } yy31: - YYDEBUG(31, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -1969,7 +1928,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy32: - YYDEBUG(32, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -2000,7 +1958,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy33: - YYDEBUG(33, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -2031,7 +1988,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy34: - YYDEBUG(34, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= '@') { @@ -2054,7 +2010,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy35: - YYDEBUG(35, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= '@') { @@ -2077,7 +2032,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy36: - YYDEBUG(36, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'F') { @@ -2115,7 +2069,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy37: - YYDEBUG(37, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'F') { @@ -2153,7 +2106,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy38: - YYDEBUG(38, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'C') { if (yych <= ')') { @@ -2176,7 +2128,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy39: - YYDEBUG(39, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'C') { if (yych <= ')') { @@ -2199,7 +2150,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy40: - YYDEBUG(40, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -2222,7 +2172,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy41: - YYDEBUG(41, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -2245,7 +2194,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy42: - YYDEBUG(42, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -2268,7 +2216,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy43: - YYDEBUG(43, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -2291,7 +2238,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy44: - YYDEBUG(44, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych == ')') goto yy139; @@ -2308,7 +2254,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy45: - YYDEBUG(45, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') goto yy12; if (yych <= 'Z') goto yy155; @@ -2316,7 +2261,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 'z') goto yy155; goto yy12; yy46: - YYDEBUG(46, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy139; @@ -2328,7 +2272,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy47: - YYDEBUG(47, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy139; @@ -2340,7 +2283,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy48: - YYDEBUG(48, *YYCURSOR); yyaccept = 2; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 4) { @@ -2349,36 +2291,29 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '/') goto yy49; if (yych <= '9') goto yy54; yy49: - YYDEBUG(49, *YYCURSOR); #line 1710 "ext/date/lib/parse_date.re" { goto std; } -#line 2358 "ext/date/lib/parse_date.c" +#line 2299 "" yy50: - YYDEBUG(50, *YYCURSOR); yych = *++YYCURSOR; goto yy49; yy51: - YYDEBUG(51, *YYCURSOR); ++YYCURSOR; - YYDEBUG(52, *YYCURSOR); #line 1715 "ext/date/lib/parse_date.re" { s->pos = cursor; s->line++; goto std; } -#line 2372 "ext/date/lib/parse_date.c" +#line 2310 "" yy53: - YYDEBUG(53, *YYCURSOR); yych = *++YYCURSOR; goto yy12; yy54: - YYDEBUG(54, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11); yych = *YYCURSOR; - YYDEBUG(55, *YYCURSOR); if (yybm[0+yych] & 2) { goto yy54; } @@ -2432,14 +2367,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy56: - YYDEBUG(56, *YYCURSOR); YYCURSOR = YYMARKER; if (yyaccept <= 16) { if (yyaccept <= 8) { if (yyaccept <= 4) { if (yyaccept <= 2) { if (yyaccept <= 1) { - if (yyaccept <= 0) { + if (yyaccept == 0) { goto yy3; } else { goto yy12; @@ -2448,7 +2382,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy49; } } else { - if (yyaccept <= 3) { + if (yyaccept == 3) { goto yy72; } else { goto yy166; @@ -2456,13 +2390,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } else { if (yyaccept <= 6) { - if (yyaccept <= 5) { + if (yyaccept == 5) { goto yy193; } else { goto yy198; } } else { - if (yyaccept <= 7) { + if (yyaccept == 7) { goto yy222; } else { goto yy294; @@ -2472,13 +2406,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } else { if (yyaccept <= 12) { if (yyaccept <= 10) { - if (yyaccept <= 9) { + if (yyaccept == 9) { goto yy392; } else { goto yy475; } } else { - if (yyaccept <= 11) { + if (yyaccept == 11) { goto yy490; } else { goto yy611; @@ -2486,13 +2420,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } else { if (yyaccept <= 14) { - if (yyaccept <= 13) { + if (yyaccept == 13) { goto yy656; } else { goto yy666; } } else { - if (yyaccept <= 15) { + if (yyaccept == 15) { goto yy763; } else { goto yy783; @@ -2505,7 +2439,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yyaccept <= 21) { if (yyaccept <= 19) { if (yyaccept <= 18) { - if (yyaccept <= 17) { + if (yyaccept == 17) { goto yy814; } else { goto yy821; @@ -2514,7 +2448,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy848; } } else { - if (yyaccept <= 20) { + if (yyaccept == 20) { goto yy793; } else { goto yy454; @@ -2522,13 +2456,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } else { if (yyaccept <= 23) { - if (yyaccept <= 22) { + if (yyaccept == 22) { goto yy973; } else { goto yy842; } } else { - if (yyaccept <= 24) { + if (yyaccept == 24) { goto yy1067; } else { goto yy1075; @@ -2538,13 +2472,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } else { if (yyaccept <= 29) { if (yyaccept <= 27) { - if (yyaccept <= 26) { + if (yyaccept == 26) { goto yy1117; } else { goto yy1141; } } else { - if (yyaccept <= 28) { + if (yyaccept == 28) { goto yy1294; } else { goto yy1417; @@ -2552,13 +2486,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } else { if (yyaccept <= 31) { - if (yyaccept <= 30) { + if (yyaccept == 30) { goto yy1420; } else { goto yy1500; } } else { - if (yyaccept <= 32) { + if (yyaccept == 32) { goto yy1508; } else { goto yy1531; @@ -2568,11 +2502,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy57: - YYDEBUG(57, *YYCURSOR); ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - YYDEBUG(58, *YYCURSOR); if (yybm[0+yych] & 4) { goto yy57; } @@ -2580,12 +2512,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy54; goto yy56; yy59: - YYDEBUG(59, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11); yych = *YYCURSOR; yy60: - YYDEBUG(60, *YYCURSOR); if (yych <= 'W') { if (yych <= 'F') { if (yych <= ' ') { @@ -2644,7 +2574,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy61: - YYDEBUG(61, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'D') { @@ -2666,7 +2595,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy62: - YYDEBUG(62, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych == 'I') goto yy117; @@ -2682,19 +2610,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy63: - YYDEBUG(63, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy114; if (yych == 'o') goto yy114; goto yy56; yy64: - YYDEBUG(64, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy113; if (yych == 'a') goto yy113; goto yy56; yy65: - YYDEBUG(65, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych == 'O') goto yy98; @@ -2710,19 +2635,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy66: - YYDEBUG(66, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy94; if (yych == 'e') goto yy94; goto yy56; yy67: - YYDEBUG(67, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy82; if (yych == 'e') goto yy82; goto yy56; yy68: - YYDEBUG(68, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'H') goto yy69; @@ -2737,24 +2659,20 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy69: - YYDEBUG(69, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'U') goto yy77; if (yych == 'u') goto yy77; goto yy56; yy70: - YYDEBUG(70, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy71; if (yych != 'e') goto yy56; yy71: - YYDEBUG(71, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'S') goto yy73; if (yych == 's') goto yy73; yy72: - YYDEBUG(72, *YYCURSOR); #line 1694 "ext/date/lib/parse_date.re" { timelib_ull i; @@ -2770,55 +2688,45 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 2774 "ext/date/lib/parse_date.c" +#line 2692 "" yy73: - YYDEBUG(73, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy74; if (yych != 'd') goto yy56; yy74: - YYDEBUG(74, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy75; if (yych != 'a') goto yy56; yy75: - YYDEBUG(75, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy76; if (yych != 'y') goto yy56; yy76: - YYDEBUG(76, *YYCURSOR); yych = *++YYCURSOR; goto yy72; yy77: - YYDEBUG(77, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'R') goto yy78; if (yych != 'r') goto yy72; yy78: - YYDEBUG(78, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy79; if (yych != 's') goto yy56; yy79: - YYDEBUG(79, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy80; if (yych != 'd') goto yy56; yy80: - YYDEBUG(80, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy81; if (yych != 'a') goto yy56; yy81: - YYDEBUG(81, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy76; if (yych == 'y') goto yy76; goto yy56; yy82: - YYDEBUG(82, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= 'C') goto yy56; @@ -2828,45 +2736,37 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 'd') goto yy84; if (yych >= 'f') goto yy56; } - YYDEBUG(83, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'K') goto yy90; if (yych == 'k') goto yy90; goto yy56; yy84: - YYDEBUG(84, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'N') goto yy85; if (yych != 'n') goto yy72; yy85: - YYDEBUG(85, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy86; if (yych != 'e') goto yy56; yy86: - YYDEBUG(86, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy87; if (yych != 's') goto yy56; yy87: - YYDEBUG(87, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy88; if (yych != 'd') goto yy56; yy88: - YYDEBUG(88, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy89; if (yych != 'a') goto yy56; yy89: - YYDEBUG(89, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy76; if (yych == 'y') goto yy76; goto yy56; yy90: - YYDEBUG(90, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -2882,55 +2782,45 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy91: - YYDEBUG(91, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy92; if (yych != 'a') goto yy56; yy92: - YYDEBUG(92, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy93; if (yych != 'y') goto yy56; yy93: - YYDEBUG(93, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy76; if (yych == 's') goto yy76; goto yy72; yy94: - YYDEBUG(94, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy95; if (yych != 'a') goto yy56; yy95: - YYDEBUG(95, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy96; if (yych != 'r') goto yy56; yy96: - YYDEBUG(96, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy76; if (yych == 's') goto yy76; goto yy72; yy97: - YYDEBUG(97, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy110; if (yych == 'i') goto yy110; goto yy56; yy98: - YYDEBUG(98, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy99; if (yych != 'r') goto yy56; yy99: - YYDEBUG(99, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy100; if (yych != 't') goto yy56; yy100: - YYDEBUG(100, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych == 'H') goto yy102; @@ -2943,100 +2833,82 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'n') goto yy56; } } - YYDEBUG(101, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy107; if (yych == 'i') goto yy107; goto yy56; yy102: - YYDEBUG(102, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy103; if (yych != 'n') goto yy56; yy103: - YYDEBUG(103, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy104; if (yych != 'i') goto yy56; yy104: - YYDEBUG(104, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'G') goto yy105; if (yych != 'g') goto yy56; yy105: - YYDEBUG(105, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'H') goto yy106; if (yych != 'h') goto yy56; yy106: - YYDEBUG(106, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy96; if (yych == 't') goto yy96; goto yy56; yy107: - YYDEBUG(107, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'G') goto yy108; if (yych != 'g') goto yy56; yy108: - YYDEBUG(108, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'H') goto yy109; if (yych != 'h') goto yy56; yy109: - YYDEBUG(109, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy96; if (yych == 't') goto yy96; goto yy56; yy110: - YYDEBUG(110, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'D') goto yy111; if (yych != 'd') goto yy72; yy111: - YYDEBUG(111, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy112; if (yych != 'a') goto yy56; yy112: - YYDEBUG(112, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy76; if (yych == 'y') goto yy76; goto yy56; yy113: - YYDEBUG(113, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy96; if (yych == 'y') goto yy96; goto yy56; yy114: - YYDEBUG(114, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'U') goto yy115; if (yych != 'u') goto yy56; yy115: - YYDEBUG(115, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy96; if (yych == 'r') goto yy96; goto yy56; yy116: - YYDEBUG(116, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy121; if (yych == 'n') goto yy121; goto yy56; yy117: - YYDEBUG(117, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy118; if (yych != 'n') goto yy56; yy118: - YYDEBUG(118, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'U') { @@ -3050,18 +2922,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'u') goto yy72; } } - YYDEBUG(119, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy120; if (yych != 't') goto yy56; yy120: - YYDEBUG(120, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy96; if (yych == 'e') goto yy96; goto yy56; yy121: - YYDEBUG(121, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -3077,42 +2946,35 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy122: - YYDEBUG(122, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy124; if (yych == 'a') goto yy124; goto yy56; yy123: - YYDEBUG(123, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'H') goto yy96; if (yych == 'h') goto yy96; goto yy56; yy124: - YYDEBUG(124, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy76; if (yych == 'y') goto yy76; goto yy56; yy125: - YYDEBUG(125, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy136; if (yych == 'n') goto yy136; goto yy56; yy126: - YYDEBUG(126, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy131; if (yych == 't') goto yy131; goto yy56; yy127: - YYDEBUG(127, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy128; if (yych != 'c') goto yy56; yy128: - YYDEBUG(128, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -3128,66 +2990,54 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy129: - YYDEBUG(129, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy130; if (yych != 'n') goto yy56; yy130: - YYDEBUG(130, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy96; if (yych == 'd') goto yy96; goto yy56; yy131: - YYDEBUG(131, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'U') goto yy132; if (yych != 'u') goto yy72; yy132: - YYDEBUG(132, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy133; if (yych != 'r') goto yy56; yy133: - YYDEBUG(133, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy134; if (yych != 'd') goto yy56; yy134: - YYDEBUG(134, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy135; if (yych != 'a') goto yy56; yy135: - YYDEBUG(135, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy76; if (yych == 'y') goto yy76; goto yy56; yy136: - YYDEBUG(136, *YYCURSOR); yyaccept = 3; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'D') goto yy137; if (yych != 'd') goto yy72; yy137: - YYDEBUG(137, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy138; if (yych != 'a') goto yy56; yy138: - YYDEBUG(138, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy76; if (yych == 'y') goto yy76; goto yy56; yy139: - YYDEBUG(139, *YYCURSOR); yych = *++YYCURSOR; goto yy3; yy140: - YYDEBUG(140, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy139; @@ -3198,7 +3048,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy3; } yy141: - YYDEBUG(141, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy139; @@ -3209,7 +3058,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy3; } yy142: - YYDEBUG(142, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy139; @@ -3220,7 +3068,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy3; } yy143: - YYDEBUG(143, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy139; @@ -3231,12 +3078,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy3; } yy144: - YYDEBUG(144, *YYCURSOR); yych = *++YYCURSOR; if (yych == ')') goto yy139; goto yy3; yy145: - YYDEBUG(145, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -3259,7 +3104,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy146: - YYDEBUG(146, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -3282,7 +3126,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy147: - YYDEBUG(147, *YYCURSOR); ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; @@ -3291,12 +3134,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } goto yy56; yy148: - YYDEBUG(148, *YYCURSOR); yyaccept = 0; YYMARKER = ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - YYDEBUG(149, *YYCURSOR); if (yybm[0+yych] & 8) { goto yy148; } @@ -3309,7 +3150,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy150: - YYDEBUG(150, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -3332,7 +3172,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy151: - YYDEBUG(151, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -3355,7 +3194,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy152: - YYDEBUG(152, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { @@ -3375,12 +3213,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy153: - YYDEBUG(153, *YYCURSOR); ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; yy154: - YYDEBUG(154, *YYCURSOR); if (yybm[0+yych] & 16) { goto yy153; } @@ -3393,7 +3229,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy155: - YYDEBUG(155, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy139; @@ -3405,7 +3240,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy156: - YYDEBUG(156, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych == ')') goto yy139; @@ -3420,7 +3254,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } } - YYDEBUG(157, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -3442,7 +3275,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy158: - YYDEBUG(158, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy159; @@ -3450,14 +3282,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy161; goto yy56; yy159: - YYDEBUG(159, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy3; if (yych <= '9') goto yy161; if (yych <= ':') goto yy162; goto yy3; yy160: - YYDEBUG(160, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '5') { if (yych <= '/') goto yy3; @@ -3468,27 +3298,23 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy161: - YYDEBUG(161, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy3; if (yych <= '5') goto yy163; if (yych <= '9') goto yy139; if (yych >= ';') goto yy3; yy162: - YYDEBUG(162, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy3; if (yych <= '5') goto yy163; if (yych <= '9') goto yy139; goto yy3; yy163: - YYDEBUG(163, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy3; if (yych <= '9') goto yy139; goto yy3; yy164: - YYDEBUG(164, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= '@') { @@ -3511,7 +3337,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy165: - YYDEBUG(165, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= 'N') { if (yych <= ')') { @@ -3531,7 +3356,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy166: - YYDEBUG(166, *YYCURSOR); #line 1557 "ext/date/lib/parse_date.re" { const timelib_relunit* relunit; @@ -3549,9 +3373,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_WEEKDAY; } -#line 3553 "ext/date/lib/parse_date.c" +#line 3377 "" yy167: - YYDEBUG(167, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'K') { if (yych <= ')') { @@ -3573,7 +3396,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy168: - YYDEBUG(168, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= ')') { @@ -3595,7 +3417,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy169: - YYDEBUG(169, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -3611,7 +3432,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy170: - YYDEBUG(170, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'X') { if (yych == ')') goto yy139; @@ -3621,16 +3441,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'y') goto yy3; } yy171: - YYDEBUG(171, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy172; if (yych != 's') goto yy166; yy172: - YYDEBUG(172, *YYCURSOR); yych = *++YYCURSOR; goto yy166; yy173: - YYDEBUG(173, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -3652,7 +3469,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy174: - YYDEBUG(174, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= ')') { @@ -3674,7 +3490,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy175: - YYDEBUG(175, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -3685,18 +3500,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'd') goto yy3; } yy176: - YYDEBUG(176, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy177; if (yych != 'a') goto yy56; yy177: - YYDEBUG(177, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy172; if (yych == 'y') goto yy172; goto yy56; yy178: - YYDEBUG(178, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -3733,7 +3545,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } } - YYDEBUG(179, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -3764,7 +3575,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy180: - YYDEBUG(180, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'J') { @@ -3795,7 +3605,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy181: - YYDEBUG(181, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -3826,7 +3635,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy182: - YYDEBUG(182, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -3852,7 +3660,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy183: - YYDEBUG(183, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'X') { @@ -3876,7 +3683,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy184: - YYDEBUG(184, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -3899,7 +3705,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy185: - YYDEBUG(185, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { @@ -3914,7 +3719,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy166; } yy186: - YYDEBUG(186, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -3945,7 +3749,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy187: - YYDEBUG(187, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'R') { @@ -3976,7 +3779,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy188: - YYDEBUG(188, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -4000,17 +3802,14 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy189: - YYDEBUG(189, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy177; if (yych != 'a') goto yy154; - YYDEBUG(190, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy172; if (yych == 'y') goto yy185; goto yy154; yy191: - YYDEBUG(191, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'C') { if (yych <= ')') { @@ -4032,7 +3831,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy192: - YYDEBUG(192, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4068,7 +3866,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy193: - YYDEBUG(193, *YYCURSOR); #line 1616 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("monthtext"); @@ -4078,14 +3875,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 4082 "ext/date/lib/parse_date.c" +#line 3879 "" yy194: - YYDEBUG(194, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 21) YYFILL(21); yych = *YYCURSOR; yy195: - YYDEBUG(195, *YYCURSOR); if (yybm[0+yych] & 32) { goto yy194; } @@ -4095,7 +3890,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy200; goto yy56; yy196: - YYDEBUG(196, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy195; if (yych <= '0') goto yy356; @@ -4103,7 +3897,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '3') goto yy358; goto yy195; yy197: - YYDEBUG(197, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -4128,7 +3921,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy198: - YYDEBUG(198, *YYCURSOR); #line 1362 "ext/date/lib/parse_date.re" { int length = 0; @@ -4142,9 +3934,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 4146 "ext/date/lib/parse_date.c" +#line 3938 "" yy199: - YYDEBUG(199, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -4169,7 +3960,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy200: - YYDEBUG(200, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -4194,7 +3984,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy201: - YYDEBUG(201, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'M') { if (yych <= ')') { @@ -4216,7 +4005,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy202: - YYDEBUG(202, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'B') { if (yych <= ')') { @@ -4238,7 +4026,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy203: - YYDEBUG(203, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -4249,12 +4036,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'e') goto yy3; } yy204: - YYDEBUG(204, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy205; if (yych != 'r') goto yy56; yy205: - YYDEBUG(205, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ' ') { @@ -4272,7 +4057,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy206: - YYDEBUG(206, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy220; @@ -4284,7 +4068,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy207: - YYDEBUG(207, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy263; @@ -4296,7 +4079,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy208: - YYDEBUG(208, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy263; @@ -4308,7 +4090,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy209: - YYDEBUG(209, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy263; @@ -4319,33 +4100,27 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy210: - YYDEBUG(210, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); goto yy215; yy211: - YYDEBUG(211, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); goto yy215; yy212: - YYDEBUG(212, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); goto yy215; yy213: - YYDEBUG(213, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); goto yy215; yy214: - YYDEBUG(214, *YYCURSOR); yyaccept = 6; YYMARKER = ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 18) YYFILL(18); yych = *YYCURSOR; yy215: - YYDEBUG(215, *YYCURSOR); if (yybm[0+yych] & 64) { goto yy214; } @@ -4358,7 +4133,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy261; if (yych != 'T') goto yy198; } - YYDEBUG(216, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy217; @@ -4366,7 +4140,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy219; goto yy56; yy217: - YYDEBUG(217, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy220; @@ -4377,7 +4150,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy218: - YYDEBUG(218, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy220; @@ -4388,19 +4160,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy219: - YYDEBUG(219, *YYCURSOR); yych = *++YYCURSOR; if (yych == '.') goto yy220; if (yych != ':') goto yy56; yy220: - YYDEBUG(220, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy221; if (yych <= '9') goto yy223; goto yy56; yy221: - YYDEBUG(221, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4410,7 +4179,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ':') goto yy224; } yy222: - YYDEBUG(222, *YYCURSOR); #line 1664 "ext/date/lib/parse_date.re" { int tz_not_found; @@ -4440,15 +4208,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 4444 "ext/date/lib/parse_date.c" +#line 4212 "" yy223: - YYDEBUG(223, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy224; if (yych != ':') goto yy222; yy224: - YYDEBUG(224, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy225; @@ -4456,22 +4222,18 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy227; goto yy56; yy225: - YYDEBUG(225, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy222; if (yych <= '9') goto yy228; goto yy222; yy226: - YYDEBUG(226, *YYCURSOR); yych = *++YYCURSOR; if (yych == '0') goto yy228; goto yy222; yy227: - YYDEBUG(227, *YYCURSOR); yych = *++YYCURSOR; goto yy222; yy228: - YYDEBUG(228, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '*') { @@ -4496,12 +4258,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy229: - YYDEBUG(229, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9); yych = *YYCURSOR; yy230: - YYDEBUG(230, *YYCURSOR); if (yych <= '+') { if (yych <= ' ') { if (yych == '\t') goto yy229; @@ -4528,7 +4288,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy231: - YYDEBUG(231, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych == ')') goto yy227; @@ -4545,7 +4304,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy232: - YYDEBUG(232, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy251; @@ -4553,7 +4311,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy253; goto yy56; yy233: - YYDEBUG(233, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') goto yy56; if (yych <= 'Z') goto yy235; @@ -4561,7 +4318,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 'z') goto yy235; goto yy56; yy234: - YYDEBUG(234, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy227; @@ -4573,7 +4329,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy235: - YYDEBUG(235, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy227; @@ -4584,7 +4339,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy222; } yy236: - YYDEBUG(236, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy227; @@ -4595,7 +4349,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy222; } yy237: - YYDEBUG(237, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy227; @@ -4606,7 +4359,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy222; } yy238: - YYDEBUG(238, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy227; @@ -4617,7 +4369,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy222; } yy239: - YYDEBUG(239, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '@') { if (yych == ')') goto yy227; @@ -4628,12 +4379,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy222; } yy240: - YYDEBUG(240, *YYCURSOR); yych = *++YYCURSOR; if (yych == ')') goto yy227; goto yy222; yy241: - YYDEBUG(241, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4656,7 +4405,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy242: - YYDEBUG(242, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4679,7 +4427,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy243: - YYDEBUG(243, *YYCURSOR); ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; @@ -4688,12 +4435,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '`') goto yy56; if (yych >= '{') goto yy56; yy244: - YYDEBUG(244, *YYCURSOR); yyaccept = 7; YYMARKER = ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - YYDEBUG(245, *YYCURSOR); if (yych <= '@') { if (yych <= '-') { if (yych <= ',') goto yy222; @@ -4714,7 +4459,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy246: - YYDEBUG(246, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4736,7 +4480,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy222; } } - YYDEBUG(247, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4758,7 +4501,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '{') goto yy222; } } - YYDEBUG(248, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -4780,11 +4522,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy249: - YYDEBUG(249, *YYCURSOR); ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - YYDEBUG(250, *YYCURSOR); if (yych <= '/') { if (yych == '-') goto yy243; if (yych <= '.') goto yy56; @@ -4800,14 +4540,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy251: - YYDEBUG(251, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy222; if (yych <= '9') goto yy253; if (yych <= ':') goto yy254; goto yy222; yy252: - YYDEBUG(252, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '5') { if (yych <= '/') goto yy222; @@ -4818,27 +4556,23 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy253: - YYDEBUG(253, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy222; if (yych <= '5') goto yy255; if (yych <= '9') goto yy227; if (yych >= ';') goto yy222; yy254: - YYDEBUG(254, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy222; if (yych <= '5') goto yy255; if (yych <= '9') goto yy227; goto yy222; yy255: - YYDEBUG(255, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy222; if (yych <= '9') goto yy227; goto yy222; yy256: - YYDEBUG(256, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych == ')') goto yy227; @@ -4853,7 +4587,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } } - YYDEBUG(257, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -4876,7 +4609,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy258: - YYDEBUG(258, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4889,7 +4621,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy259: - YYDEBUG(259, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4902,7 +4633,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy260: - YYDEBUG(260, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4915,7 +4645,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy261: - YYDEBUG(261, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4927,20 +4656,17 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy262: - YYDEBUG(262, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy198; if (yych <= '9') goto yy288; goto yy198; yy263: - YYDEBUG(263, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy264; if (yych <= '9') goto yy265; goto yy56; yy264: - YYDEBUG(264, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -4952,13 +4678,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy265: - YYDEBUG(265, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy266; if (yych != ':') goto yy222; yy266: - YYDEBUG(266, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy267; @@ -4966,17 +4690,14 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy227; goto yy56; yy267: - YYDEBUG(267, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy222; if (yych <= '9') goto yy269; goto yy222; yy268: - YYDEBUG(268, *YYCURSOR); yych = *++YYCURSOR; if (yych != '0') goto yy222; yy269: - YYDEBUG(269, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '*') { @@ -5001,12 +4722,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy270: - YYDEBUG(270, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9); yych = *YYCURSOR; yy271: - YYDEBUG(271, *YYCURSOR); if (yych <= '@') { if (yych <= '\'') { if (yych <= '\t') { @@ -5048,7 +4767,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy272: - YYDEBUG(272, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'L') { @@ -5072,7 +4790,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy273: - YYDEBUG(273, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'L') { @@ -5096,13 +4813,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy274: - YYDEBUG(274, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy279; if (yych == 'm') goto yy279; goto yy56; yy275: - YYDEBUG(275, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ')') { @@ -5126,7 +4841,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy276: - YYDEBUG(276, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\t') { if (yych <= 0x00) goto yy277; @@ -5135,9 +4849,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != ' ') goto yy56; } yy277: - YYDEBUG(277, *YYCURSOR); ++YYCURSOR; - YYDEBUG(278, *YYCURSOR); #line 1640 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("dateshortwithtimeshort12 | dateshortwithtimelong12"); @@ -5161,9 +4873,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_SHORTDATE_WITH_TIME; } -#line 5165 "ext/date/lib/parse_date.c" +#line 4877 "" yy279: - YYDEBUG(279, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x00) goto yy277; @@ -5175,7 +4886,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy280: - YYDEBUG(280, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '-') { @@ -5211,7 +4921,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy281: - YYDEBUG(281, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ':') { @@ -5239,11 +4948,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy282: - YYDEBUG(282, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = *YYCURSOR; - YYDEBUG(283, *YYCURSOR); if (yych <= 'A') { if (yych <= 0x1F) { if (yych == '\t') goto yy282; @@ -5261,7 +4968,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy284: - YYDEBUG(284, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych != '.') goto yy56; @@ -5271,12 +4977,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy285: - YYDEBUG(285, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy286; if (yych != 'm') goto yy56; yy286: - YYDEBUG(286, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x00) goto yy277; @@ -5287,7 +4991,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != '.') goto yy56; } yy287: - YYDEBUG(287, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\t') { if (yych <= 0x00) goto yy277; @@ -5298,15 +5001,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy288: - YYDEBUG(288, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy198; if (yych >= ':') goto yy198; - YYDEBUG(289, *YYCURSOR); yych = *++YYCURSOR; goto yy198; yy290: - YYDEBUG(290, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5318,7 +5018,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy291: - YYDEBUG(291, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5330,15 +5029,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy292: - YYDEBUG(292, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; yy293: - YYDEBUG(293, *YYCURSOR); ++YYCURSOR; yy294: - YYDEBUG(294, *YYCURSOR); #line 1334 "ext/date/lib/parse_date.re" { int length = 0; @@ -5352,9 +5048,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 5356 "ext/date/lib/parse_date.c" +#line 5052 "" yy295: - YYDEBUG(295, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy220; @@ -5365,7 +5060,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy296: - YYDEBUG(296, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy263; @@ -5376,7 +5070,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy297: - YYDEBUG(297, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -5402,7 +5095,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy298: - YYDEBUG(298, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -5427,7 +5119,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy299: - YYDEBUG(299, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '1') { @@ -5441,7 +5132,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy215; } yy300: - YYDEBUG(300, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy263; @@ -5453,7 +5143,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy301: - YYDEBUG(301, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy263; @@ -5465,7 +5154,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy302: - YYDEBUG(302, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy263; @@ -5477,21 +5165,18 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy303: - YYDEBUG(303, *YYCURSOR); yyaccept = 8; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy220; if (yych == ':') goto yy220; goto yy294; yy304: - YYDEBUG(304, *YYCURSOR); yyaccept = 8; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy263; if (yych == ':') goto yy263; goto yy294; yy305: - YYDEBUG(305, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5504,7 +5189,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy306: - YYDEBUG(306, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5517,7 +5201,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy307: - YYDEBUG(307, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5530,7 +5213,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy308: - YYDEBUG(308, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5542,7 +5224,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy309: - YYDEBUG(309, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5552,7 +5233,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= ';') goto yy198; } yy310: - YYDEBUG(310, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy311; @@ -5560,7 +5240,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy265; goto yy56; yy311: - YYDEBUG(311, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5572,7 +5251,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy312: - YYDEBUG(312, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5584,7 +5262,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy313: - YYDEBUG(313, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -5619,12 +5296,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy314: - YYDEBUG(314, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9); yych = *YYCURSOR; yy315: - YYDEBUG(315, *YYCURSOR); if (yych <= '@') { if (yych <= '\'') { if (yych <= '\t') { @@ -5666,7 +5341,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy316: - YYDEBUG(316, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'L') { @@ -5690,7 +5364,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy317: - YYDEBUG(317, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'L') { @@ -5714,7 +5387,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy318: - YYDEBUG(318, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ')') { @@ -5739,12 +5411,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy319: - YYDEBUG(319, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy320; if (yych != 'm') goto yy56; yy320: - YYDEBUG(320, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x00) goto yy277; @@ -5755,7 +5425,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != '.') goto yy56; } yy321: - YYDEBUG(321, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\t') { if (yych <= 0x00) goto yy277; @@ -5766,7 +5435,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy322: - YYDEBUG(322, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '-') { @@ -5802,7 +5470,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy323: - YYDEBUG(323, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ':') { @@ -5836,7 +5503,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy324: - YYDEBUG(324, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ':') { @@ -5868,7 +5534,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy325: - YYDEBUG(325, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy326; @@ -5876,7 +5541,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy223; goto yy56; yy326: - YYDEBUG(326, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5888,7 +5552,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy327: - YYDEBUG(327, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -5900,7 +5563,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy328: - YYDEBUG(328, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -5935,7 +5597,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy329: - YYDEBUG(329, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ':') { @@ -5969,7 +5630,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy330: - YYDEBUG(330, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '1') { @@ -5983,7 +5643,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy215; } yy331: - YYDEBUG(331, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy220; @@ -5995,7 +5654,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy332: - YYDEBUG(332, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6008,7 +5666,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy333: - YYDEBUG(333, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6021,7 +5678,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy334: - YYDEBUG(334, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6034,7 +5690,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy335: - YYDEBUG(335, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6046,7 +5701,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy336: - YYDEBUG(336, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6056,7 +5710,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= ';') goto yy198; } yy337: - YYDEBUG(337, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy338; @@ -6064,7 +5717,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy265; goto yy56; yy338: - YYDEBUG(338, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6076,7 +5728,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy339: - YYDEBUG(339, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6088,7 +5739,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy340: - YYDEBUG(340, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -6123,12 +5773,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy341: - YYDEBUG(341, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9); yych = *YYCURSOR; yy342: - YYDEBUG(342, *YYCURSOR); if (yych <= '@') { if (yych <= '\'') { if (yych <= '\t') { @@ -6170,7 +5818,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy343: - YYDEBUG(343, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'L') { @@ -6194,7 +5841,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy344: - YYDEBUG(344, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'L') { @@ -6218,7 +5864,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy345: - YYDEBUG(345, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ')') { @@ -6243,7 +5888,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy346: - YYDEBUG(346, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '-') { @@ -6279,7 +5923,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy347: - YYDEBUG(347, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6291,7 +5934,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy348: - YYDEBUG(348, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6301,7 +5943,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= ';') goto yy198; } yy349: - YYDEBUG(349, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy350; @@ -6309,7 +5950,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy223; goto yy56; yy350: - YYDEBUG(350, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6321,7 +5961,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy351: - YYDEBUG(351, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6333,7 +5972,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy222; } yy352: - YYDEBUG(352, *YYCURSOR); yyaccept = 7; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -6368,7 +6006,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy353: - YYDEBUG(353, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6380,7 +6017,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy198; } yy354: - YYDEBUG(354, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -6406,7 +6042,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy355: - YYDEBUG(355, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -6432,7 +6067,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy356: - YYDEBUG(356, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -6457,7 +6091,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy357: - YYDEBUG(357, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -6482,7 +6115,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy358: - YYDEBUG(358, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -6506,7 +6138,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy359: - YYDEBUG(359, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -6534,7 +6165,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy360: - YYDEBUG(360, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -6562,16 +6192,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy361: - YYDEBUG(361, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(362, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '/') goto yy363; if (yych <= '9') goto yy364; yy363: - YYDEBUG(363, *YYCURSOR); #line 1478 "ext/date/lib/parse_date.re" { int length = 0; @@ -6585,21 +6212,17 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 6589 "ext/date/lib/parse_date.c" +#line 6216 "" yy364: - YYDEBUG(364, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy363; if (yych >= ':') goto yy363; - YYDEBUG(365, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy363; if (yych >= ':') goto yy363; - YYDEBUG(366, *YYCURSOR); yych = *++YYCURSOR; goto yy363; yy367: - YYDEBUG(367, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -6627,7 +6250,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy368: - YYDEBUG(368, *YYCURSOR); yyaccept = 6; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -6655,7 +6277,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy369: - YYDEBUG(369, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'B') { @@ -6686,7 +6307,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy370: - YYDEBUG(370, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -6730,7 +6350,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy371: - YYDEBUG(371, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 8) { goto yy148; @@ -6741,7 +6360,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '3') goto yy358; goto yy195; yy372: - YYDEBUG(372, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'L') { @@ -6772,7 +6390,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy373: - YYDEBUG(373, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'A') { @@ -6803,7 +6420,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy374: - YYDEBUG(374, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -6827,12 +6443,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy375: - YYDEBUG(375, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy205; if (yych != 'r') goto yy154; yy376: - YYDEBUG(376, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { @@ -6856,14 +6470,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy377: - YYDEBUG(377, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 8) { goto yy148; } goto yy195; yy378: - YYDEBUG(378, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -6885,7 +6497,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy379: - YYDEBUG(379, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -6927,7 +6538,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy380: - YYDEBUG(380, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'B') { if (yych <= ')') { @@ -6949,7 +6559,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy381: - YYDEBUG(381, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -6971,7 +6580,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy382: - YYDEBUG(382, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Q') { if (yych == ')') goto yy139; @@ -6982,7 +6590,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy383: - YYDEBUG(383, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -7013,7 +6620,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy384: - YYDEBUG(384, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -7058,7 +6664,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy385: - YYDEBUG(385, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'A') { @@ -7089,7 +6694,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy386: - YYDEBUG(386, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -7120,7 +6724,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy387: - YYDEBUG(387, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -7144,7 +6747,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy388: - YYDEBUG(388, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'G') { if (yych <= ')') { @@ -7167,7 +6769,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy389: - YYDEBUG(389, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= ')') { @@ -7190,7 +6791,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy390: - YYDEBUG(390, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= ')') { @@ -7212,7 +6812,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy391: - YYDEBUG(391, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '@') { if (yych == ')') goto yy139; @@ -7222,7 +6821,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 'z') goto yy142; } yy392: - YYDEBUG(392, *YYCURSOR); #line 1536 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("ago"); @@ -7243,9 +6841,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_AGO; } -#line 7247 "ext/date/lib/parse_date.c" +#line 6845 "" yy393: - YYDEBUG(393, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -7287,7 +6884,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy394: - YYDEBUG(394, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych <= ')') { @@ -7309,7 +6905,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy395: - YYDEBUG(395, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -7334,7 +6929,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy396: - YYDEBUG(396, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -7376,7 +6970,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy397: - YYDEBUG(397, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= ')') { @@ -7398,7 +6991,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy398: - YYDEBUG(398, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -7420,7 +7012,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy399: - YYDEBUG(399, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '(') { @@ -7443,7 +7034,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy400: - YYDEBUG(400, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'F') { @@ -7474,7 +7064,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy401: - YYDEBUG(401, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -7505,7 +7094,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy402: - YYDEBUG(402, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { @@ -7536,7 +7124,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy403: - YYDEBUG(403, *YYCURSOR); yyaccept = 9; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -7560,7 +7147,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy404: - YYDEBUG(404, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -7605,7 +7191,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy405: - YYDEBUG(405, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'K') { @@ -7636,7 +7221,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy406: - YYDEBUG(406, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -7672,7 +7256,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy407: - YYDEBUG(407, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -7717,7 +7300,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy408: - YYDEBUG(408, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'R') { @@ -7748,7 +7330,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy409: - YYDEBUG(409, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -7779,7 +7360,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy410: - YYDEBUG(410, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { @@ -7806,7 +7386,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy411: - YYDEBUG(411, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= '@') { @@ -7830,7 +7409,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy412: - YYDEBUG(412, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -7852,7 +7430,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy413: - YYDEBUG(413, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -7894,7 +7471,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy414: - YYDEBUG(414, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -7910,7 +7486,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy415: - YYDEBUG(415, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= ')') { @@ -7932,7 +7507,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy416: - YYDEBUG(416, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'X') { if (yych == ')') goto yy139; @@ -7943,7 +7517,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy417: - YYDEBUG(417, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -7986,7 +7559,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy418: - YYDEBUG(418, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -8028,7 +7600,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy419: - YYDEBUG(419, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -8053,7 +7624,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy420: - YYDEBUG(420, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -8095,7 +7665,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy421: - YYDEBUG(421, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -8126,7 +7695,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy422: - YYDEBUG(422, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -8171,7 +7739,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy423: - YYDEBUG(423, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -8197,7 +7764,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy424: - YYDEBUG(424, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -8228,7 +7794,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy425: - YYDEBUG(425, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'X') { @@ -8252,7 +7817,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy426: - YYDEBUG(426, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -8297,7 +7861,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy427: - YYDEBUG(427, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -8342,7 +7905,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy428: - YYDEBUG(428, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -8378,7 +7940,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy429: - YYDEBUG(429, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -8408,7 +7969,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy430: - YYDEBUG(430, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -8433,7 +7993,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy431: - YYDEBUG(431, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -8462,7 +8021,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } } - YYDEBUG(432, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -8491,7 +8049,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } } - YYDEBUG(433, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -8516,7 +8073,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy434: - YYDEBUG(434, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -8541,7 +8097,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy435: - YYDEBUG(435, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -8572,7 +8127,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy436: - YYDEBUG(436, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -8639,7 +8193,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy437: - YYDEBUG(437, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -8715,7 +8268,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy438: - YYDEBUG(438, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -8787,11 +8339,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy439: - YYDEBUG(439, *YYCURSOR); ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - YYDEBUG(440, *YYCURSOR); if (yybm[0+yych] & 4) { goto yy57; } @@ -8805,7 +8355,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy441: - YYDEBUG(441, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -8868,7 +8417,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy442: - YYDEBUG(442, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -8931,40 +8479,33 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy443: - YYDEBUG(443, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych >= ':') goto yy60; yy444: - YYDEBUG(444, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 2) { goto yy54; } if (yych != '-') goto yy60; yy445: - YYDEBUG(445, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '0') goto yy446; if (yych <= '1') goto yy447; goto yy56; yy446: - YYDEBUG(446, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy448; goto yy56; yy447: - YYDEBUG(447, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '3') goto yy56; yy448: - YYDEBUG(448, *YYCURSOR); yych = *++YYCURSOR; if (yych != '-') goto yy56; - YYDEBUG(449, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '0') goto yy450; @@ -8972,27 +8513,22 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '3') goto yy452; goto yy56; yy450: - YYDEBUG(450, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy453; goto yy56; yy451: - YYDEBUG(451, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy453; goto yy56; yy452: - YYDEBUG(452, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '2') goto yy56; yy453: - YYDEBUG(453, *YYCURSOR); ++YYCURSOR; yy454: - YYDEBUG(454, *YYCURSOR); #line 1239 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("iso8601date4 | iso8601date2 | iso8601dateslash | dateslash"); @@ -9004,9 +8540,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 9008 "ext/date/lib/parse_date.c" +#line 8544 "" yy455: - YYDEBUG(455, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -9069,7 +8604,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy456: - YYDEBUG(456, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -9139,7 +8673,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } } - YYDEBUG(457, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -9202,7 +8735,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy458: - YYDEBUG(458, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 2) { @@ -9267,7 +8799,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy459: - YYDEBUG(459, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy461; if (yych <= '0') goto yy735; @@ -9275,13 +8806,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy737; goto yy461; yy460: - YYDEBUG(460, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 13) YYFILL(13); yych = *YYCURSOR; yy461: - YYDEBUG(461, *YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': case ' ': goto yy460; @@ -9319,7 +8847,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy56; } yy462: - YYDEBUG(462, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'D') { @@ -9341,7 +8868,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy463: - YYDEBUG(463, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '`') { if (yych <= 'D') { @@ -9365,7 +8891,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy464: - YYDEBUG(464, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'H') { @@ -9387,7 +8912,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy465: - YYDEBUG(465, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych == 'A') goto yy113; @@ -9403,7 +8927,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy466: - YYDEBUG(466, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= 'N') { @@ -9425,7 +8948,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy467: - YYDEBUG(467, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'H') goto yy69; @@ -9441,14 +8963,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy468: - YYDEBUG(468, *YYCURSOR); yych = *++YYCURSOR; if (yych == '-') goto yy741; if (yych <= '/') goto yy60; if (yych <= '9') goto yy740; goto yy60; yy469: - YYDEBUG(469, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'c') { if (yych == 'O') goto yy529; @@ -9459,14 +8979,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy470: - YYDEBUG(470, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'd') goto yy728; goto yy56; yy471: - YYDEBUG(471, *YYCURSOR); yych = *++YYCURSOR; - YYDEBUG(-1, yych); switch (yych) { case '0': case '1': @@ -9497,9 +9014,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy56; } yy472: - YYDEBUG(472, *YYCURSOR); yych = *++YYCURSOR; - YYDEBUG(-1, yych); switch (yych) { case '0': goto yy615; case '1': goto yy616; @@ -9530,7 +9045,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy577; } yy473: - YYDEBUG(473, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '1') { if (yych <= '/') goto yy577; @@ -9542,7 +9056,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy577; } yy474: - YYDEBUG(474, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -9563,7 +9076,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy475: - YYDEBUG(475, *YYCURSOR); #line 1376 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("datenoyearrev"); @@ -9575,9 +9087,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_TEXT; } -#line 9579 "ext/date/lib/parse_date.c" +#line 9091 "" yy476: - YYDEBUG(476, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -9599,7 +9110,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy477: - YYDEBUG(477, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -9621,7 +9131,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy478: - YYDEBUG(478, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'A') goto yy556; @@ -9637,7 +9146,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy479: - YYDEBUG(479, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= 'L') { @@ -9660,26 +9168,22 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy480: - YYDEBUG(480, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy543; if (yych == 'c') goto yy543; goto yy56; yy481: - YYDEBUG(481, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy529; if (yych == 'o') goto yy529; goto yy56; yy482: - YYDEBUG(482, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy489; if (yych <= '9') goto yy491; goto yy56; yy483: - YYDEBUG(483, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych != '.') goto yy56; @@ -9689,12 +9193,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy484: - YYDEBUG(484, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy485; if (yych != 'm') goto yy56; yy485: - YYDEBUG(485, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x00) goto yy487; @@ -9704,7 +9206,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ' ') goto yy487; if (yych != '.') goto yy56; } - YYDEBUG(486, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\t') { if (yych <= 0x00) goto yy487; @@ -9713,9 +9214,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != ' ') goto yy56; } yy487: - YYDEBUG(487, *YYCURSOR); ++YYCURSOR; - YYDEBUG(488, *YYCURSOR); #line 1094 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("timetiny12 | timeshort12 | timelong12"); @@ -9732,9 +9231,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIME12; } -#line 9736 "ext/date/lib/parse_date.c" +#line 9235 "" yy489: - YYDEBUG(489, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -9744,7 +9242,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ':') goto yy492; } yy490: - YYDEBUG(490, *YYCURSOR); #line 1131 "ext/date/lib/parse_date.re" { int tz_not_found; @@ -9770,15 +9267,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 9774 "ext/date/lib/parse_date.c" +#line 9271 "" yy491: - YYDEBUG(491, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy492; if (yych != ':') goto yy490; yy492: - YYDEBUG(492, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy493; @@ -9786,7 +9281,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy495; goto yy56; yy493: - YYDEBUG(493, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy496; @@ -9794,33 +9288,27 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy499; goto yy490; yy494: - YYDEBUG(494, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy496; if (yych == '0') goto yy499; goto yy490; yy495: - YYDEBUG(495, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych != '.') goto yy490; yy496: - YYDEBUG(496, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; yy497: - YYDEBUG(497, *YYCURSOR); ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - YYDEBUG(498, *YYCURSOR); if (yych <= '/') goto yy490; if (yych <= '9') goto yy497; goto yy490; yy499: - YYDEBUG(499, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -9843,11 +9331,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy500: - YYDEBUG(500, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = *YYCURSOR; - YYDEBUG(501, *YYCURSOR); if (yych <= 'A') { if (yych <= 0x1F) { if (yych == '\t') goto yy500; @@ -9865,7 +9351,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy502: - YYDEBUG(502, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych != '.') goto yy56; @@ -9874,12 +9359,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych == 'm') goto yy504; goto yy56; } - YYDEBUG(503, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy504; if (yych != 'm') goto yy56; yy504: - YYDEBUG(504, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x00) goto yy487; @@ -9889,7 +9372,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ' ') goto yy487; if (yych != '.') goto yy56; } - YYDEBUG(505, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\t') { if (yych <= 0x00) goto yy487; @@ -9900,7 +9382,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy506: - YYDEBUG(506, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ':') { @@ -9928,11 +9409,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy507: - YYDEBUG(507, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = *YYCURSOR; - YYDEBUG(508, *YYCURSOR); if (yych <= 'A') { if (yych <= 0x1F) { if (yych == '\t') goto yy507; @@ -9950,7 +9429,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy509: - YYDEBUG(509, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych == '.') goto yy526; @@ -9961,7 +9439,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy510: - YYDEBUG(510, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy511; @@ -9969,7 +9446,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy495; goto yy56; yy511: - YYDEBUG(511, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy496; @@ -9977,13 +9453,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy513; goto yy490; yy512: - YYDEBUG(512, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy496; if (yych != '0') goto yy490; yy513: - YYDEBUG(513, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ':') { @@ -10012,22 +9486,18 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy514: - YYDEBUG(514, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy524; goto yy56; yy515: - YYDEBUG(515, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; yy516: - YYDEBUG(516, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = *YYCURSOR; - YYDEBUG(517, *YYCURSOR); if (yych <= 'O') { if (yych <= '9') { if (yych <= '/') goto yy56; @@ -10044,7 +9514,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy518: - YYDEBUG(518, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych != '.') goto yy56; @@ -10053,12 +9522,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych == 'm') goto yy520; goto yy56; } - YYDEBUG(519, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy520; if (yych != 'm') goto yy56; yy520: - YYDEBUG(520, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x00) goto yy522; @@ -10068,7 +9535,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ' ') goto yy522; if (yych != '.') goto yy56; } - YYDEBUG(521, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\t') { if (yych <= 0x00) goto yy522; @@ -10077,9 +9543,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != ' ') goto yy56; } yy522: - YYDEBUG(522, *YYCURSOR); ++YYCURSOR; - YYDEBUG(523, *YYCURSOR); #line 1111 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("mssqltime"); @@ -10099,14 +9563,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_TIME24_WITH_ZONE; } -#line 10103 "ext/date/lib/parse_date.c" +#line 9567 "" yy524: - YYDEBUG(524, *YYCURSOR); yyaccept = 11; YYMARKER = ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = *YYCURSOR; - YYDEBUG(525, *YYCURSOR); if (yych <= 'O') { if (yych <= '9') { if (yych <= '/') goto yy490; @@ -10126,12 +9588,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy526: - YYDEBUG(526, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy527; if (yych != 'm') goto yy56; yy527: - YYDEBUG(527, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x00) goto yy487; @@ -10141,7 +9601,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ' ') goto yy487; if (yych != '.') goto yy56; } - YYDEBUG(528, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\t') { if (yych <= 0x00) goto yy487; @@ -10152,12 +9611,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy529: - YYDEBUG(529, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'V') goto yy530; if (yych != 'v') goto yy56; yy530: - YYDEBUG(530, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10179,12 +9636,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy531: - YYDEBUG(531, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 4) YYFILL(4); yych = *YYCURSOR; yy532: - YYDEBUG(532, *YYCURSOR); if (yych <= ' ') { if (yych == '\t') goto yy531; if (yych <= 0x1F) goto yy56; @@ -10199,12 +9654,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy533: - YYDEBUG(533, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '/') goto yy534; if (yych <= '9') goto yy540; yy534: - YYDEBUG(534, *YYCURSOR); #line 1293 "ext/date/lib/parse_date.re" { int length = 0; @@ -10219,29 +9672,24 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_FULL; } -#line 10223 "ext/date/lib/parse_date.c" +#line 9676 "" yy535: - YYDEBUG(535, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy536; if (yych != 'm') goto yy56; yy536: - YYDEBUG(536, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy537; if (yych != 'b') goto yy56; yy537: - YYDEBUG(537, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy538; if (yych != 'e') goto yy56; yy538: - YYDEBUG(538, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy539; if (yych != 'r') goto yy56; yy539: - YYDEBUG(539, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ' ') { @@ -10259,25 +9707,20 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy540: - YYDEBUG(540, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy534; if (yych >= ':') goto yy534; yy541: - YYDEBUG(541, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy534; if (yych >= ':') goto yy534; - YYDEBUG(542, *YYCURSOR); yych = *++YYCURSOR; goto yy534; yy543: - YYDEBUG(543, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy544; if (yych != 't') goto yy56; yy544: - YYDEBUG(544, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10300,34 +9743,28 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy545: - YYDEBUG(545, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy546; if (yych != 'b') goto yy56; yy546: - YYDEBUG(546, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy547; if (yych != 'e') goto yy56; yy547: - YYDEBUG(547, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy539; if (yych == 'r') goto yy539; goto yy56; yy548: - YYDEBUG(548, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'G') goto yy552; if (yych == 'g') goto yy552; goto yy56; yy549: - YYDEBUG(549, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy550; if (yych != 'r') goto yy56; yy550: - YYDEBUG(550, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10350,13 +9787,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy551: - YYDEBUG(551, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'L') goto yy539; if (yych == 'l') goto yy539; goto yy56; yy552: - YYDEBUG(552, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10379,18 +9814,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy553: - YYDEBUG(553, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy554; if (yych != 's') goto yy56; yy554: - YYDEBUG(554, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy539; if (yych == 't') goto yy539; goto yy56; yy555: - YYDEBUG(555, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych == 'L') goto yy562; @@ -10406,12 +9838,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy556: - YYDEBUG(556, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy557; if (yych != 'n') goto yy56; yy557: - YYDEBUG(557, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10434,23 +9864,19 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy558: - YYDEBUG(558, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy559; if (yych != 'a') goto yy56; yy559: - YYDEBUG(559, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy560; if (yych != 'r') goto yy56; yy560: - YYDEBUG(560, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy539; if (yych == 'y') goto yy539; goto yy56; yy561: - YYDEBUG(561, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10474,7 +9900,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy562: - YYDEBUG(562, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10498,7 +9923,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy563: - YYDEBUG(563, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -10520,7 +9944,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy564: - YYDEBUG(564, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -10540,7 +9963,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'I') goto yy475; } } - YYDEBUG(565, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -10562,7 +9984,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy566: - YYDEBUG(566, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -10584,7 +10005,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy567: - YYDEBUG(567, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10598,7 +10018,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy568: - YYDEBUG(568, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -10613,7 +10032,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy569: - YYDEBUG(569, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10627,7 +10045,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy570: - YYDEBUG(570, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10639,19 +10056,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy571: - YYDEBUG(571, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy594; if (yych == 'e') goto yy594; goto yy56; yy572: - YYDEBUG(572, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy591; if (yych == 'a') goto yy591; goto yy56; yy573: - YYDEBUG(573, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'P') goto yy549; @@ -10667,25 +10081,20 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy574: - YYDEBUG(574, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy584; if (yych == 'e') goto yy584; goto yy56; yy575: - YYDEBUG(575, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy578; if (yych == 'e') goto yy578; goto yy56; yy576: - YYDEBUG(576, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 13) YYFILL(13); yych = *YYCURSOR; yy577: - YYDEBUG(577, *YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': case ' ': @@ -10713,12 +10122,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy56; } yy578: - YYDEBUG(578, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy579; if (yych != 'c') goto yy56; yy579: - YYDEBUG(579, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10741,33 +10148,27 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy580: - YYDEBUG(580, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy581; if (yych != 'm') goto yy56; yy581: - YYDEBUG(581, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy582; if (yych != 'b') goto yy56; yy582: - YYDEBUG(582, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy583; if (yych != 'e') goto yy56; yy583: - YYDEBUG(583, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy539; if (yych == 'r') goto yy539; goto yy56; yy584: - YYDEBUG(584, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'P') goto yy585; if (yych != 'p') goto yy56; yy585: - YYDEBUG(585, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10790,7 +10191,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy586: - YYDEBUG(586, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10813,28 +10213,23 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy587: - YYDEBUG(587, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy588; if (yych != 'm') goto yy56; yy588: - YYDEBUG(588, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy589; if (yych != 'b') goto yy56; yy589: - YYDEBUG(589, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy590; if (yych != 'e') goto yy56; yy590: - YYDEBUG(590, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy539; if (yych == 'r') goto yy539; goto yy56; yy591: - YYDEBUG(591, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych == 'R') goto yy592; @@ -10849,7 +10244,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy592: - YYDEBUG(592, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10872,18 +10266,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy593: - YYDEBUG(593, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'H') goto yy539; if (yych == 'h') goto yy539; goto yy56; yy594: - YYDEBUG(594, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy595; if (yych != 'b') goto yy56; yy595: - YYDEBUG(595, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -10906,28 +10297,23 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy596: - YYDEBUG(596, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'U') goto yy597; if (yych != 'u') goto yy56; yy597: - YYDEBUG(597, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy598; if (yych != 'a') goto yy56; yy598: - YYDEBUG(598, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy599; if (yych != 'r') goto yy56; yy599: - YYDEBUG(599, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy539; if (yych == 'y') goto yy539; goto yy56; yy600: - YYDEBUG(600, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy607; @@ -10935,27 +10321,21 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy609; goto yy56; yy601: - YYDEBUG(601, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(602, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; yy603: - YYDEBUG(603, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; yy604: - YYDEBUG(604, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(605, *YYCURSOR); ++YYCURSOR; - YYDEBUG(606, *YYCURSOR); #line 1308 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("pointed date YYYY"); @@ -10967,9 +10347,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 10971 "ext/date/lib/parse_date.c" +#line 10351 "" yy607: - YYDEBUG(607, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy496; @@ -10977,7 +10356,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy612; goto yy490; yy608: - YYDEBUG(608, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -10989,20 +10367,17 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy609: - YYDEBUG(609, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy496; if (yych <= '/') goto yy490; if (yych >= ':') goto yy490; yy610: - YYDEBUG(610, *YYCURSOR); yyaccept = 12; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy611; if (yych <= '9') goto yy604; yy611: - YYDEBUG(611, *YYCURSOR); #line 1320 "ext/date/lib/parse_date.re" { int length = 0; @@ -11016,9 +10391,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_FULL_POINTED; } -#line 11020 "ext/date/lib/parse_date.c" +#line 10395 "" yy612: - YYDEBUG(612, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -11047,7 +10421,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy613: - YYDEBUG(613, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ':') { @@ -11076,7 +10449,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy614: - YYDEBUG(614, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ':') { @@ -11110,7 +10482,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy615: - YYDEBUG(615, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '.') { if (yych <= ',') goto yy56; @@ -11122,7 +10493,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy616: - YYDEBUG(616, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '.') { if (yych <= ',') goto yy56; @@ -11133,14 +10503,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '3') goto yy56; } yy617: - YYDEBUG(617, *YYCURSOR); yych = *++YYCURSOR; if (yych <= ',') goto yy56; if (yych <= '-') goto yy654; if (yych <= '.') goto yy601; goto yy56; yy618: - YYDEBUG(618, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'A') goto yy650; @@ -11156,19 +10524,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy619: - YYDEBUG(619, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy647; if (yych == 'e') goto yy647; goto yy56; yy620: - YYDEBUG(620, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy644; if (yych == 'a') goto yy644; goto yy56; yy621: - YYDEBUG(621, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'P') goto yy641; @@ -11184,35 +10549,29 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy622: - YYDEBUG(622, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy637; if (yych == 'e') goto yy637; goto yy56; yy623: - YYDEBUG(623, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy635; if (yych == 'c') goto yy635; goto yy56; yy624: - YYDEBUG(624, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy633; if (yych == 'o') goto yy633; goto yy56; yy625: - YYDEBUG(625, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy626; if (yych != 'e') goto yy56; yy626: - YYDEBUG(626, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy627; if (yych != 'c') goto yy56; yy627: - YYDEBUG(627, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11236,7 +10595,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy628: - YYDEBUG(628, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy532; if (yych <= '0') goto yy629; @@ -11244,37 +10602,31 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '3') goto yy631; goto yy532; yy629: - YYDEBUG(629, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy534; if (yych <= '9') goto yy632; goto yy534; yy630: - YYDEBUG(630, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy534; if (yych <= '9') goto yy632; goto yy534; yy631: - YYDEBUG(631, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy534; if (yych <= '1') goto yy632; if (yych <= '9') goto yy540; goto yy534; yy632: - YYDEBUG(632, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy534; if (yych <= '9') goto yy541; goto yy534; yy633: - YYDEBUG(633, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'V') goto yy634; if (yych != 'v') goto yy56; yy634: - YYDEBUG(634, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11299,12 +10651,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy635: - YYDEBUG(635, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy636; if (yych != 't') goto yy56; yy636: - YYDEBUG(636, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11329,12 +10679,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy637: - YYDEBUG(637, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'P') goto yy638; if (yych != 'p') goto yy56; yy638: - YYDEBUG(638, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11358,7 +10706,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy639: - YYDEBUG(639, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11383,18 +10730,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy640: - YYDEBUG(640, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'G') goto yy643; if (yych == 'g') goto yy643; goto yy56; yy641: - YYDEBUG(641, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy642; if (yych != 'r') goto yy56; yy642: - YYDEBUG(642, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11419,7 +10763,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy643: - YYDEBUG(643, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11444,7 +10787,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy644: - YYDEBUG(644, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych == 'R') goto yy645; @@ -11459,7 +10801,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy645: - YYDEBUG(645, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11484,7 +10825,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy646: - YYDEBUG(646, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ',') { @@ -11506,12 +10846,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy647: - YYDEBUG(647, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy648; if (yych != 'b') goto yy56; yy648: - YYDEBUG(648, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11536,7 +10874,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy649: - YYDEBUG(649, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych == 'L') goto yy653; @@ -11552,12 +10889,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy650: - YYDEBUG(650, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy651; if (yych != 'n') goto yy56; yy651: - YYDEBUG(651, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11582,7 +10917,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy652: - YYDEBUG(652, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11607,7 +10941,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy653: - YYDEBUG(653, *YYCURSOR); yyaccept = 10; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -11632,7 +10965,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy654: - YYDEBUG(654, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '2') goto yy655; @@ -11640,7 +10972,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy658; goto yy56; yy655: - YYDEBUG(655, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -11656,7 +10987,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy656: - YYDEBUG(656, *YYCURSOR); #line 1279 "ext/date/lib/parse_date.re" { int length = 0; @@ -11670,9 +11000,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 11674 "ext/date/lib/parse_date.c" +#line 11004 "" yy657: - YYDEBUG(657, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -11695,7 +11024,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy658: - YYDEBUG(658, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -11714,30 +11042,24 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy659: - YYDEBUG(659, *YYCURSOR); yych = *++YYCURSOR; if (yych == 't') goto yy663; goto yy56; yy660: - YYDEBUG(660, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'd') goto yy663; goto yy56; yy661: - YYDEBUG(661, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'd') goto yy663; goto yy56; yy662: - YYDEBUG(662, *YYCURSOR); yych = *++YYCURSOR; if (yych != 'h') goto yy56; yy663: - YYDEBUG(663, *YYCURSOR); yych = *++YYCURSOR; goto yy656; yy664: - YYDEBUG(664, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -11756,7 +11078,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy665: - YYDEBUG(665, *YYCURSOR); yyaccept = 14; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -11775,7 +11096,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy666: - YYDEBUG(666, *YYCURSOR); #line 1223 "ext/date/lib/parse_date.re" { int length = 0; @@ -11791,9 +11111,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_AMERICAN; } -#line 11795 "ext/date/lib/parse_date.c" +#line 11115 "" yy667: - YYDEBUG(667, *YYCURSOR); yyaccept = 14; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -11816,7 +11135,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy668: - YYDEBUG(668, *YYCURSOR); yyaccept = 14; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -11834,7 +11152,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy669: - YYDEBUG(669, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'A') goto yy717; @@ -11850,19 +11167,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy670: - YYDEBUG(670, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy715; if (yych == 'e') goto yy715; goto yy56; yy671: - YYDEBUG(671, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy714; if (yych == 'a') goto yy714; goto yy56; yy672: - YYDEBUG(672, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'P') goto yy713; @@ -11878,116 +11192,92 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy673: - YYDEBUG(673, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy710; if (yych == 'e') goto yy710; goto yy56; yy674: - YYDEBUG(674, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy709; if (yych == 'c') goto yy709; goto yy56; yy675: - YYDEBUG(675, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy708; if (yych == 'o') goto yy708; goto yy56; yy676: - YYDEBUG(676, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy677; if (yych != 'e') goto yy56; yy677: - YYDEBUG(677, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy678; if (yych != 'c') goto yy56; yy678: - YYDEBUG(678, *YYCURSOR); yych = *++YYCURSOR; if (yych != '/') goto yy56; yy679: - YYDEBUG(679, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(680, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(681, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(682, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(683, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; - YYDEBUG(684, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy685; if (yych <= '2') goto yy686; goto yy56; yy685: - YYDEBUG(685, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy687; goto yy56; yy686: - YYDEBUG(686, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '5') goto yy56; yy687: - YYDEBUG(687, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; - YYDEBUG(688, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '6') goto yy56; - YYDEBUG(689, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(690, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; - YYDEBUG(691, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy692; if (yych <= '6') goto yy693; goto yy56; yy692: - YYDEBUG(692, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy694; goto yy56; yy693: - YYDEBUG(693, *YYCURSOR); yych = *++YYCURSOR; if (yych != '0') goto yy56; yy694: - YYDEBUG(694, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\t') goto yy695; if (yych != ' ') goto yy56; yy695: - YYDEBUG(695, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9); yych = *YYCURSOR; - YYDEBUG(696, *YYCURSOR); if (yych <= '*') { if (yych <= '\t') { if (yych <= 0x08) goto yy56; @@ -12004,12 +11294,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'G') goto yy56; } } - YYDEBUG(697, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy706; goto yy56; yy698: - YYDEBUG(698, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy699; @@ -12017,13 +11305,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy702; goto yy56; yy699: - YYDEBUG(699, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '/') goto yy700; if (yych <= '9') goto yy702; if (yych <= ':') goto yy703; yy700: - YYDEBUG(700, *YYCURSOR); #line 1506 "ext/date/lib/parse_date.re" { int tz_not_found; @@ -12044,9 +11330,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 12048 "ext/date/lib/parse_date.c" +#line 11334 "" yy701: - YYDEBUG(701, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '5') { if (yych <= '/') goto yy700; @@ -12057,56 +11342,46 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy700; } yy702: - YYDEBUG(702, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy700; if (yych <= '5') goto yy704; if (yych <= '9') goto yy705; if (yych >= ';') goto yy700; yy703: - YYDEBUG(703, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy700; if (yych <= '5') goto yy704; if (yych <= '9') goto yy705; goto yy700; yy704: - YYDEBUG(704, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy700; if (yych >= ':') goto yy700; yy705: - YYDEBUG(705, *YYCURSOR); yych = *++YYCURSOR; goto yy700; yy706: - YYDEBUG(706, *YYCURSOR); yych = *++YYCURSOR; if (yych != 'T') goto yy56; - YYDEBUG(707, *YYCURSOR); yych = *++YYCURSOR; if (yych == '+') goto yy698; if (yych == '-') goto yy698; goto yy56; yy708: - YYDEBUG(708, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'V') goto yy678; if (yych == 'v') goto yy678; goto yy56; yy709: - YYDEBUG(709, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy678; if (yych == 't') goto yy678; goto yy56; yy710: - YYDEBUG(710, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'P') goto yy711; if (yych != 'p') goto yy56; yy711: - YYDEBUG(711, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych == '/') goto yy679; @@ -12117,19 +11392,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy712: - YYDEBUG(712, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'G') goto yy678; if (yych == 'g') goto yy678; goto yy56; yy713: - YYDEBUG(713, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy678; if (yych == 'r') goto yy678; goto yy56; yy714: - YYDEBUG(714, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych == 'R') goto yy678; @@ -12145,13 +11417,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy715: - YYDEBUG(715, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy678; if (yych == 'b') goto yy678; goto yy56; yy716: - YYDEBUG(716, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych == 'L') goto yy678; @@ -12167,59 +11437,47 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy717: - YYDEBUG(717, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy678; if (yych == 'n') goto yy678; goto yy56; yy718: - YYDEBUG(718, *YYCURSOR); yych = *++YYCURSOR; if (yych == 't') goto yy727; goto yy56; yy719: - YYDEBUG(719, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'd') goto yy727; goto yy56; yy720: - YYDEBUG(720, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'd') goto yy727; goto yy56; yy721: - YYDEBUG(721, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'h') goto yy727; goto yy56; yy722: - YYDEBUG(722, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(723, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy666; if (yych >= ':') goto yy666; - YYDEBUG(724, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy666; if (yych >= ':') goto yy666; - YYDEBUG(725, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy666; if (yych >= ':') goto yy666; - YYDEBUG(726, *YYCURSOR); yych = *++YYCURSOR; goto yy666; yy727: - YYDEBUG(727, *YYCURSOR); yyaccept = 14; yych = *(YYMARKER = ++YYCURSOR); if (yych == '/') goto yy722; goto yy666; yy728: - YYDEBUG(728, *YYCURSOR); yych = *++YYCURSOR; if (yych <= ',') { if (yych == '\t') goto yy730; @@ -12230,9 +11488,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '0') goto yy577; } yy729: - YYDEBUG(729, *YYCURSOR); yych = *++YYCURSOR; - YYDEBUG(-1, yych); switch (yych) { case 'A': case 'a': goto yy672; @@ -12253,7 +11509,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy56; } yy730: - YYDEBUG(730, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy577; if (yych <= '0') goto yy735; @@ -12261,7 +11516,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy737; goto yy577; yy731: - YYDEBUG(731, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy577; if (yych <= '0') goto yy732; @@ -12269,7 +11523,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy734; goto yy577; yy732: - YYDEBUG(732, *YYCURSOR); yych = *++YYCURSOR; if (yych <= ',') goto yy56; if (yych <= '.') goto yy601; @@ -12277,20 +11530,17 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy734; goto yy56; yy733: - YYDEBUG(733, *YYCURSOR); yych = *++YYCURSOR; if (yych <= ',') goto yy56; if (yych <= '.') goto yy601; if (yych <= '/') goto yy56; if (yych >= '3') goto yy56; yy734: - YYDEBUG(734, *YYCURSOR); yych = *++YYCURSOR; if (yych <= ',') goto yy56; if (yych <= '.') goto yy601; goto yy56; yy735: - YYDEBUG(735, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '.') { if (yych <= ',') goto yy56; @@ -12302,7 +11552,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy736: - YYDEBUG(736, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '.') { if (yych <= ',') goto yy56; @@ -12313,32 +11562,26 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '3') goto yy56; } yy737: - YYDEBUG(737, *YYCURSOR); yych = *++YYCURSOR; if (yych <= ',') goto yy56; if (yych <= '-') goto yy601; if (yych >= '/') goto yy56; yy738: - YYDEBUG(738, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(739, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy610; goto yy56; yy740: - YYDEBUG(740, *YYCURSOR); yych = *++YYCURSOR; if (yych == '-') goto yy784; if (yych <= '/') goto yy60; if (yych <= '9') goto yy782; goto yy60; yy741: - YYDEBUG(741, *YYCURSOR); yych = *++YYCURSOR; - YYDEBUG(-1, yych); switch (yych) { case '0': goto yy750; case '1': goto yy751; @@ -12369,7 +11612,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy56; } yy742: - YYDEBUG(742, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'A') goto yy781; @@ -12385,19 +11627,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy743: - YYDEBUG(743, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy779; if (yych == 'e') goto yy779; goto yy56; yy744: - YYDEBUG(744, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy778; if (yych == 'a') goto yy778; goto yy56; yy745: - YYDEBUG(745, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'P') goto yy777; @@ -12413,49 +11652,41 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy746: - YYDEBUG(746, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy774; if (yych == 'e') goto yy774; goto yy56; yy747: - YYDEBUG(747, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy773; if (yych == 'c') goto yy773; goto yy56; yy748: - YYDEBUG(748, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy772; if (yych == 'o') goto yy772; goto yy56; yy749: - YYDEBUG(749, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy764; if (yych == 'e') goto yy764; goto yy56; yy750: - YYDEBUG(750, *YYCURSOR); yych = *++YYCURSOR; if (yych == '-') goto yy753; if (yych <= '/') goto yy56; if (yych <= '9') goto yy757; goto yy56; yy751: - YYDEBUG(751, *YYCURSOR); yych = *++YYCURSOR; if (yych == '-') goto yy753; if (yych <= '/') goto yy56; if (yych <= '2') goto yy757; goto yy56; yy752: - YYDEBUG(752, *YYCURSOR); yych = *++YYCURSOR; if (yych != '-') goto yy56; yy753: - YYDEBUG(753, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '2') goto yy754; @@ -12463,7 +11694,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy756; goto yy56; yy754: - YYDEBUG(754, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -12482,7 +11712,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy755: - YYDEBUG(755, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -12501,7 +11730,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy756: - YYDEBUG(756, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'q') { @@ -12514,10 +11742,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy656; } yy757: - YYDEBUG(757, *YYCURSOR); yych = *++YYCURSOR; if (yych != '-') goto yy56; - YYDEBUG(758, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '2') { if (yych <= '/') goto yy56; @@ -12527,7 +11753,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy756; goto yy56; } - YYDEBUG(759, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -12546,7 +11771,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy760: - YYDEBUG(760, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -12565,7 +11789,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy761: - YYDEBUG(761, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -12584,7 +11807,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy762: - YYDEBUG(762, *YYCURSOR); yyaccept = 15; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'q') { @@ -12595,7 +11817,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 't') goto yy662; } yy763: - YYDEBUG(763, *YYCURSOR); #line 1251 "ext/date/lib/parse_date.re" { int length = 0; @@ -12609,18 +11830,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 12613 "ext/date/lib/parse_date.c" +#line 11834 "" yy764: - YYDEBUG(764, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy765; if (yych != 'c') goto yy56; yy765: - YYDEBUG(765, *YYCURSOR); yych = *++YYCURSOR; if (yych != '-') goto yy56; yy766: - YYDEBUG(766, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '0') goto yy767; @@ -12628,26 +11846,21 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '3') goto yy769; goto yy56; yy767: - YYDEBUG(767, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy770; goto yy56; yy768: - YYDEBUG(768, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy770; goto yy56; yy769: - YYDEBUG(769, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '2') goto yy56; yy770: - YYDEBUG(770, *YYCURSOR); ++YYCURSOR; - YYDEBUG(771, *YYCURSOR); #line 1492 "ext/date/lib/parse_date.re" { int length = 0; @@ -12661,26 +11874,22 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_PG_TEXT; } -#line 12665 "ext/date/lib/parse_date.c" +#line 11878 "" yy772: - YYDEBUG(772, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'V') goto yy765; if (yych == 'v') goto yy765; goto yy56; yy773: - YYDEBUG(773, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy765; if (yych == 't') goto yy765; goto yy56; yy774: - YYDEBUG(774, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'P') goto yy775; if (yych != 'p') goto yy56; yy775: - YYDEBUG(775, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych == '-') goto yy766; @@ -12691,19 +11900,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy776: - YYDEBUG(776, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'G') goto yy765; if (yych == 'g') goto yy765; goto yy56; yy777: - YYDEBUG(777, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy765; if (yych == 'r') goto yy765; goto yy56; yy778: - YYDEBUG(778, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych == 'R') goto yy765; @@ -12719,13 +11925,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy779: - YYDEBUG(779, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy765; if (yych == 'b') goto yy765; goto yy56; yy780: - YYDEBUG(780, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych == 'L') goto yy765; @@ -12741,16 +11945,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy781: - YYDEBUG(781, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy765; if (yych == 'n') goto yy765; goto yy56; yy782: - YYDEBUG(782, *YYCURSOR); yyaccept = 16; yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': case ' ': @@ -12798,7 +11999,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy783; } yy783: - YYDEBUG(783, *YYCURSOR); #line 1527 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("year4"); @@ -12807,11 +12007,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_CLF; } -#line 12811 "ext/date/lib/parse_date.c" +#line 12011 "" yy784: - YYDEBUG(784, *YYCURSOR); yych = *++YYCURSOR; - YYDEBUG(-1, yych); switch (yych) { case '0': goto yy785; case '1': goto yy786; @@ -12842,23 +12040,19 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy56; } yy785: - YYDEBUG(785, *YYCURSOR); yych = *++YYCURSOR; if (yych == '-') goto yy753; if (yych <= '/') goto yy56; if (yych <= '9') goto yy752; goto yy56; yy786: - YYDEBUG(786, *YYCURSOR); yych = *++YYCURSOR; if (yych == '-') goto yy753; if (yych <= '/') goto yy56; if (yych <= '2') goto yy752; goto yy56; yy787: - YYDEBUG(787, *YYCURSOR); yych = *++YYCURSOR; - YYDEBUG(-1, yych); switch (yych) { case '0': goto yy972; case '1': goto yy974; @@ -12890,7 +12084,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy938; } yy788: - YYDEBUG(788, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '0') goto yy946; @@ -12898,13 +12091,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy948; goto yy56; yy789: - YYDEBUG(789, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11); yych = *YYCURSOR; yy790: - YYDEBUG(790, *YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': case ' ': goto yy789; @@ -12940,7 +12130,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy56; } yy791: - YYDEBUG(791, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy938; if (yych <= '0') goto yy930; @@ -12948,7 +12137,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '3') goto yy932; goto yy938; yy792: - YYDEBUG(792, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= 'U') { if (yych == 'I') goto yy929; @@ -12957,7 +12145,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 'X') goto yy883; } yy793: - YYDEBUG(793, *YYCURSOR); #line 1348 "ext/date/lib/parse_date.re" { int length = 0; @@ -12971,19 +12158,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_NO_DAY; } -#line 12975 "ext/date/lib/parse_date.c" +#line 12162 "" yy794: - YYDEBUG(794, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy927; goto yy793; yy795: - YYDEBUG(795, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy926; goto yy793; yy796: - YYDEBUG(796, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'A') goto yy919; @@ -12999,7 +12183,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy797: - YYDEBUG(797, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= 'N') { @@ -13021,7 +12204,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy798: - YYDEBUG(798, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= 'H') { @@ -13043,7 +12225,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy799: - YYDEBUG(799, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'P') goto yy903; @@ -13059,7 +12240,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy800: - YYDEBUG(800, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'D') { @@ -13081,19 +12261,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy801: - YYDEBUG(801, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy890; if (yych == 'c') goto yy890; goto yy56; yy802: - YYDEBUG(802, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy884; if (yych == 'o') goto yy884; goto yy56; yy803: - YYDEBUG(803, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych == 'A') goto yy113; @@ -13109,34 +12286,29 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy804: - YYDEBUG(804, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '0') goto yy874; if (yych <= '9') goto yy875; goto yy60; yy805: - YYDEBUG(805, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '2') goto yy843; if (yych <= '9') goto yy822; goto yy60; yy806: - YYDEBUG(806, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '0') goto yy823; if (yych <= '1') goto yy824; goto yy56; yy807: - YYDEBUG(807, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '9') goto yy822; goto yy60; yy808: - YYDEBUG(808, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '5') goto yy818; @@ -13144,7 +12316,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy54; goto yy60; yy809: - YYDEBUG(809, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '5') { if (yych <= '/') goto yy56; @@ -13161,31 +12332,26 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy810: - YYDEBUG(810, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '0') goto yy56; if (yych <= '9') goto yy813; goto yy56; yy811: - YYDEBUG(811, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy813; goto yy56; yy812: - YYDEBUG(812, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '4') goto yy56; yy813: - YYDEBUG(813, *YYCURSOR); yyaccept = 17; yych = *(YYMARKER = ++YYCURSOR); if (yych == '-') goto yy815; if (yych <= '/') goto yy814; if (yych <= '7') goto yy816; yy814: - YYDEBUG(814, *YYCURSOR); #line 1459 "ext/date/lib/parse_date.re" { timelib_sll w, d; @@ -13204,16 +12370,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 13208 "ext/date/lib/parse_date.c" +#line 12374 "" yy815: - YYDEBUG(815, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '8') goto yy56; yy816: - YYDEBUG(816, *YYCURSOR); ++YYCURSOR; - YYDEBUG(817, *YYCURSOR); #line 1440 "ext/date/lib/parse_date.re" { timelib_sll w, d; @@ -13232,22 +12395,19 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_WEEK; } -#line 13236 "ext/date/lib/parse_date.c" +#line 12399 "" yy818: - YYDEBUG(818, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '9') goto yy820; goto yy60; yy819: - YYDEBUG(819, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '6') goto yy820; if (yych <= '9') goto yy54; goto yy60; yy820: - YYDEBUG(820, *YYCURSOR); yyaccept = 18; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 2) { @@ -13295,7 +12455,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy821: - YYDEBUG(821, *YYCURSOR); #line 1426 "ext/date/lib/parse_date.re" { int length = 0; @@ -13309,29 +12468,24 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_PG_YEARDAY; } -#line 13313 "ext/date/lib/parse_date.c" +#line 12472 "" yy822: - YYDEBUG(822, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '9') goto yy820; goto yy60; yy823: - YYDEBUG(823, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy825; goto yy56; yy824: - YYDEBUG(824, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '3') goto yy56; yy825: - YYDEBUG(825, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; - YYDEBUG(826, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '0') goto yy827; @@ -13339,79 +12493,63 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '3') goto yy829; goto yy56; yy827: - YYDEBUG(827, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy830; goto yy56; yy828: - YYDEBUG(828, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy830; goto yy56; yy829: - YYDEBUG(829, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '2') goto yy56; yy830: - YYDEBUG(830, *YYCURSOR); yych = *++YYCURSOR; if (yych != ' ') goto yy56; - YYDEBUG(831, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy832; if (yych <= '2') goto yy833; goto yy56; yy832: - YYDEBUG(832, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy834; goto yy56; yy833: - YYDEBUG(833, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '5') goto yy56; yy834: - YYDEBUG(834, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; - YYDEBUG(835, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '6') goto yy56; - YYDEBUG(836, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(837, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; - YYDEBUG(838, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy839; if (yych <= '6') goto yy840; goto yy56; yy839: - YYDEBUG(839, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy841; goto yy56; yy840: - YYDEBUG(840, *YYCURSOR); yych = *++YYCURSOR; if (yych != '0') goto yy56; yy841: - YYDEBUG(841, *YYCURSOR); ++YYCURSOR; yy842: - YYDEBUG(842, *YYCURSOR); #line 1400 "ext/date/lib/parse_date.re" { int tz_not_found; @@ -13437,9 +12575,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_XMLRPC_SOAP; } -#line 13441 "ext/date/lib/parse_date.c" +#line 12579 "" yy843: - YYDEBUG(843, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '2') { if (yych <= '/') goto yy60; @@ -13450,7 +12587,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy60; } yy844: - YYDEBUG(844, *YYCURSOR); yyaccept = 18; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -13513,7 +12649,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy845: - YYDEBUG(845, *YYCURSOR); yyaccept = 18; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -13576,7 +12711,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy846: - YYDEBUG(846, *YYCURSOR); yyaccept = 18; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -13642,7 +12776,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy847: - YYDEBUG(847, *YYCURSOR); yyaccept = 19; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 2) { @@ -13698,7 +12831,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy848: - YYDEBUG(848, *YYCURSOR); #line 1388 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("datenocolon"); @@ -13710,9 +12842,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_DATE_NOCOLON; } -#line 13714 "ext/date/lib/parse_date.c" +#line 12846 "" yy849: - YYDEBUG(849, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'H') { if (yych <= '2') { @@ -13735,7 +12866,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy850: - YYDEBUG(850, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'H') { if (yych <= '2') { @@ -13756,56 +12886,47 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } } - YYDEBUG(851, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy858; if (yych <= '9') goto yy853; goto yy56; yy852: - YYDEBUG(852, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '4') goto yy858; if (yych <= '5') goto yy854; goto yy56; yy853: - YYDEBUG(853, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '6') goto yy56; yy854: - YYDEBUG(854, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; yy855: - YYDEBUG(855, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy856; if (yych <= '6') goto yy857; goto yy56; yy856: - YYDEBUG(856, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy841; goto yy56; yy857: - YYDEBUG(857, *YYCURSOR); yych = *++YYCURSOR; if (yych == '0') goto yy841; goto yy56; yy858: - YYDEBUG(858, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy859; if (yych <= '9') goto yy855; goto yy56; yy859: - YYDEBUG(859, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy860; @@ -13813,7 +12934,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy855; goto yy56; yy860: - YYDEBUG(860, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy862; @@ -13821,7 +12941,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy841; goto yy56; yy861: - YYDEBUG(861, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '0') goto yy862; @@ -13829,18 +12948,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '6') goto yy857; goto yy56; yy862: - YYDEBUG(862, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy842; if (yych <= '9') goto yy841; goto yy842; yy863: - YYDEBUG(863, *YYCURSOR); yych = *++YYCURSOR; if (yych == '0') goto yy841; goto yy842; yy864: - YYDEBUG(864, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy873; @@ -13848,7 +12964,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ':') goto yy867; goto yy56; yy865: - YYDEBUG(865, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '5') { if (yych <= '/') goto yy56; @@ -13859,42 +12974,34 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy866: - YYDEBUG(866, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy854; if (yych != ':') goto yy56; yy867: - YYDEBUG(867, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= '6') goto yy56; - YYDEBUG(868, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(869, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; - YYDEBUG(870, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy871; if (yych <= '6') goto yy872; goto yy56; yy871: - YYDEBUG(871, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy841; goto yy56; yy872: - YYDEBUG(872, *YYCURSOR); yych = *++YYCURSOR; if (yych == '0') goto yy841; goto yy56; yy873: - YYDEBUG(873, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy859; @@ -13902,7 +13009,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ':') goto yy867; goto yy56; yy874: - YYDEBUG(874, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '2') { if (yych <= '/') goto yy60; @@ -13914,7 +13020,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy60; } yy875: - YYDEBUG(875, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '2') { if (yych <= '/') goto yy60; @@ -13926,107 +13031,87 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy60; } yy876: - YYDEBUG(876, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '9') goto yy847; goto yy60; yy877: - YYDEBUG(877, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy878; if (yych != 'c') goto yy56; yy878: - YYDEBUG(878, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'E') goto yy879; if (yych != 'e') goto yy793; yy879: - YYDEBUG(879, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy880; if (yych != 'm') goto yy56; yy880: - YYDEBUG(880, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy881; if (yych != 'b') goto yy56; yy881: - YYDEBUG(881, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy882; if (yych != 'e') goto yy56; yy882: - YYDEBUG(882, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy883; if (yych != 'r') goto yy56; yy883: - YYDEBUG(883, *YYCURSOR); yych = *++YYCURSOR; goto yy793; yy884: - YYDEBUG(884, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'V') goto yy885; if (yych != 'v') goto yy56; yy885: - YYDEBUG(885, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'E') goto yy886; if (yych != 'e') goto yy793; yy886: - YYDEBUG(886, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy887; if (yych != 'm') goto yy56; yy887: - YYDEBUG(887, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy888; if (yych != 'b') goto yy56; yy888: - YYDEBUG(888, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy889; if (yych != 'e') goto yy56; yy889: - YYDEBUG(889, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy883; if (yych == 'r') goto yy883; goto yy56; yy890: - YYDEBUG(890, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy891; if (yych != 't') goto yy56; yy891: - YYDEBUG(891, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'O') goto yy892; if (yych != 'o') goto yy793; yy892: - YYDEBUG(892, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy893; if (yych != 'b') goto yy56; yy893: - YYDEBUG(893, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy894; if (yych != 'e') goto yy56; yy894: - YYDEBUG(894, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy883; if (yych == 'r') goto yy883; goto yy56; yy895: - YYDEBUG(895, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'P') { if (yych == 'C') goto yy128; @@ -14040,79 +13125,65 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy896: - YYDEBUG(896, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy897; if (yych != 't') goto yy793; yy897: - YYDEBUG(897, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'E') goto yy898; if (yych != 'e') goto yy793; yy898: - YYDEBUG(898, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy899; if (yych != 'm') goto yy56; yy899: - YYDEBUG(899, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy900; if (yych != 'b') goto yy56; yy900: - YYDEBUG(900, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy901; if (yych != 'e') goto yy56; yy901: - YYDEBUG(901, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy883; if (yych == 'r') goto yy883; goto yy56; yy902: - YYDEBUG(902, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'G') goto yy906; if (yych == 'g') goto yy906; goto yy56; yy903: - YYDEBUG(903, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy904; if (yych != 'r') goto yy56; yy904: - YYDEBUG(904, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'I') goto yy905; if (yych != 'i') goto yy793; yy905: - YYDEBUG(905, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'L') goto yy883; if (yych == 'l') goto yy883; goto yy56; yy906: - YYDEBUG(906, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'U') goto yy907; if (yych != 'u') goto yy793; yy907: - YYDEBUG(907, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy908; if (yych != 's') goto yy56; yy908: - YYDEBUG(908, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy883; if (yych == 't') goto yy883; goto yy56; yy909: - YYDEBUG(909, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych == 'R') goto yy910; @@ -14127,51 +13198,42 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy910: - YYDEBUG(910, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'C') goto yy911; if (yych != 'c') goto yy793; yy911: - YYDEBUG(911, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'H') goto yy883; if (yych == 'h') goto yy883; goto yy56; yy912: - YYDEBUG(912, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy913; if (yych != 'b') goto yy56; yy913: - YYDEBUG(913, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'R') goto yy914; if (yych != 'r') goto yy793; yy914: - YYDEBUG(914, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'U') goto yy915; if (yych != 'u') goto yy56; yy915: - YYDEBUG(915, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy916; if (yych != 'a') goto yy56; yy916: - YYDEBUG(916, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy917; if (yych != 'r') goto yy56; yy917: - YYDEBUG(917, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy883; if (yych == 'y') goto yy883; goto yy56; yy918: - YYDEBUG(918, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych == 'L') goto yy925; @@ -14187,114 +13249,93 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy919: - YYDEBUG(919, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy920; if (yych != 'n') goto yy56; yy920: - YYDEBUG(920, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'U') goto yy921; if (yych != 'u') goto yy793; yy921: - YYDEBUG(921, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy922; if (yych != 'a') goto yy56; yy922: - YYDEBUG(922, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy923; if (yych != 'r') goto yy56; yy923: - YYDEBUG(923, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy883; if (yych == 'y') goto yy883; goto yy56; yy924: - YYDEBUG(924, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy883; if (yych == 'e') goto yy883; goto yy793; yy925: - YYDEBUG(925, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy883; if (yych == 'y') goto yy883; goto yy793; yy926: - YYDEBUG(926, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy883; goto yy793; yy927: - YYDEBUG(927, *YYCURSOR); yych = *++YYCURSOR; if (yych != 'I') goto yy793; - YYDEBUG(928, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy883; goto yy793; yy929: - YYDEBUG(929, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy883; goto yy793; yy930: - YYDEBUG(930, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '0') goto yy945; if (yych <= '9') goto yy944; goto yy56; yy931: - YYDEBUG(931, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy943; goto yy56; yy932: - YYDEBUG(932, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy941; if (yych <= '6') goto yy940; goto yy56; yy933: - YYDEBUG(933, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy912; if (yych == 'e') goto yy912; goto yy56; yy934: - YYDEBUG(934, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy909; if (yych == 'a') goto yy909; goto yy56; yy935: - YYDEBUG(935, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy939; if (yych == 'e') goto yy939; goto yy56; yy936: - YYDEBUG(936, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy877; if (yych == 'e') goto yy877; goto yy56; yy937: - YYDEBUG(937, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9); yych = *YYCURSOR; yy938: - YYDEBUG(938, *YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': case ' ': @@ -14322,64 +13363,53 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy56; } yy939: - YYDEBUG(939, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'P') goto yy896; if (yych == 'p') goto yy896; goto yy56; yy940: - YYDEBUG(940, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '6') goto yy942; goto yy56; yy941: - YYDEBUG(941, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; yy942: - YYDEBUG(942, *YYCURSOR); yych = *++YYCURSOR; goto yy821; yy943: - YYDEBUG(943, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy942; goto yy56; yy944: - YYDEBUG(944, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy942; goto yy56; yy945: - YYDEBUG(945, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '0') goto yy56; if (yych <= '9') goto yy942; goto yy56; yy946: - YYDEBUG(946, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '.') goto yy56; if (yych <= '/') goto yy949; if (yych <= '9') goto yy957; goto yy56; yy947: - YYDEBUG(947, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '.') goto yy56; if (yych <= '/') goto yy949; if (yych <= '2') goto yy957; goto yy56; yy948: - YYDEBUG(948, *YYCURSOR); yych = *++YYCURSOR; if (yych != '/') goto yy56; yy949: - YYDEBUG(949, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '2') goto yy950; @@ -14387,7 +13417,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy952; goto yy56; yy950: - YYDEBUG(950, *YYCURSOR); yyaccept = 21; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -14406,7 +13435,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy951: - YYDEBUG(951, *YYCURSOR); yyaccept = 21; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -14425,7 +13453,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy952: - YYDEBUG(952, *YYCURSOR); yyaccept = 21; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'q') { @@ -14438,30 +13465,24 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy454; } yy953: - YYDEBUG(953, *YYCURSOR); yych = *++YYCURSOR; if (yych == 't') goto yy453; goto yy56; yy954: - YYDEBUG(954, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'd') goto yy453; goto yy56; yy955: - YYDEBUG(955, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'd') goto yy453; goto yy56; yy956: - YYDEBUG(956, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'h') goto yy453; goto yy56; yy957: - YYDEBUG(957, *YYCURSOR); yych = *++YYCURSOR; if (yych != '/') goto yy56; - YYDEBUG(958, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '2') { if (yych <= '/') goto yy56; @@ -14471,7 +13492,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy952; goto yy56; } - YYDEBUG(959, *YYCURSOR); yyaccept = 21; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -14490,7 +13510,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy960: - YYDEBUG(960, *YYCURSOR); yyaccept = 21; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -14509,7 +13528,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy961: - YYDEBUG(961, *YYCURSOR); yyaccept = 21; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -14528,7 +13546,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy962: - YYDEBUG(962, *YYCURSOR); yyaccept = 21; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -14546,7 +13563,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy963: - YYDEBUG(963, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'A') goto yy1043; @@ -14562,19 +13578,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy964: - YYDEBUG(964, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1040; if (yych == 'e') goto yy1040; goto yy56; yy965: - YYDEBUG(965, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1037; if (yych == 'a') goto yy1037; goto yy56; yy966: - YYDEBUG(966, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'P') goto yy1034; @@ -14590,31 +13603,26 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy967: - YYDEBUG(967, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1030; if (yych == 'e') goto yy1030; goto yy56; yy968: - YYDEBUG(968, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy1028; if (yych == 'c') goto yy1028; goto yy56; yy969: - YYDEBUG(969, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy1026; if (yych == 'o') goto yy1026; goto yy56; yy970: - YYDEBUG(970, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1024; if (yych == 'e') goto yy1024; goto yy56; yy971: - YYDEBUG(971, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '0') goto yy810; @@ -14622,14 +13630,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '5') goto yy812; goto yy56; yy972: - YYDEBUG(972, *YYCURSOR); yyaccept = 22; yych = *(YYMARKER = ++YYCURSOR); if (yych == '-') goto yy976; if (yych <= '/') goto yy973; if (yych <= '9') goto yy995; yy973: - YYDEBUG(973, *YYCURSOR); #line 1265 "ext/date/lib/parse_date.re" { int length = 0; @@ -14643,9 +13649,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_DATE; } -#line 14647 "ext/date/lib/parse_date.c" +#line 13653 "" yy974: - YYDEBUG(974, *YYCURSOR); yyaccept = 22; yych = *(YYMARKER = ++YYCURSOR); if (yych == '-') goto yy976; @@ -14653,12 +13658,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '2') goto yy995; goto yy973; yy975: - YYDEBUG(975, *YYCURSOR); yyaccept = 22; yych = *(YYMARKER = ++YYCURSOR); if (yych != '-') goto yy973; yy976: - YYDEBUG(976, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '2') goto yy977; @@ -14666,7 +13669,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy979; goto yy56; yy977: - YYDEBUG(977, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -14689,7 +13691,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy978: - YYDEBUG(978, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -14711,7 +13712,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy979: - YYDEBUG(979, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -14729,27 +13729,22 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy980: - YYDEBUG(980, *YYCURSOR); yych = *++YYCURSOR; if (yych == 't') goto yy994; goto yy56; yy981: - YYDEBUG(981, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'd') goto yy994; goto yy56; yy982: - YYDEBUG(982, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'd') goto yy994; goto yy56; yy983: - YYDEBUG(983, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'h') goto yy994; goto yy56; yy984: - YYDEBUG(984, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy985; @@ -14757,43 +13752,36 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy987; goto yy56; yy985: - YYDEBUG(985, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy987; if (yych <= ':') goto yy988; goto yy56; yy986: - YYDEBUG(986, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '4') goto yy987; if (yych == ':') goto yy988; goto yy56; yy987: - YYDEBUG(987, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; yy988: - YYDEBUG(988, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy989; if (yych <= '9') goto yy990; goto yy56; yy989: - YYDEBUG(989, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy990; if (yych <= ':') goto yy991; goto yy56; yy990: - YYDEBUG(990, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; yy991: - YYDEBUG(991, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy992; @@ -14801,28 +13789,23 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy841; goto yy56; yy992: - YYDEBUG(992, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy842; if (yych <= '9') goto yy841; goto yy842; yy993: - YYDEBUG(993, *YYCURSOR); yych = *++YYCURSOR; if (yych == '0') goto yy841; goto yy842; yy994: - YYDEBUG(994, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych == 'T') goto yy984; goto yy656; yy995: - YYDEBUG(995, *YYCURSOR); yyaccept = 22; yych = *(YYMARKER = ++YYCURSOR); if (yych != '-') goto yy973; - YYDEBUG(996, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '2') { if (yych <= '/') goto yy56; @@ -14832,7 +13815,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy979; goto yy56; } - YYDEBUG(997, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -14855,7 +13837,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy998: - YYDEBUG(998, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -14878,7 +13859,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy999: - YYDEBUG(999, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'm') { @@ -14900,7 +13880,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1000: - YYDEBUG(1000, *YYCURSOR); yyaccept = 21; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -14918,7 +13897,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1001: - YYDEBUG(1001, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy1002; @@ -14926,41 +13904,34 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy987; goto yy56; yy1002: - YYDEBUG(1002, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy1004; if (yych <= ':') goto yy988; goto yy56; yy1003: - YYDEBUG(1003, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '4') goto yy1004; if (yych == ':') goto yy988; goto yy56; yy1004: - YYDEBUG(1004, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; - YYDEBUG(1005, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy1006; if (yych <= '9') goto yy990; goto yy56; yy1006: - YYDEBUG(1006, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy1007; if (yych <= ':') goto yy991; goto yy56; yy1007: - YYDEBUG(1007, *YYCURSOR); yych = *++YYCURSOR; if (yych != ':') goto yy56; - YYDEBUG(1008, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy1009; @@ -14968,31 +13939,25 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy841; goto yy56; yy1009: - YYDEBUG(1009, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy842; if (yych <= '9') goto yy1011; goto yy842; yy1010: - YYDEBUG(1010, *YYCURSOR); yych = *++YYCURSOR; if (yych != '0') goto yy842; yy1011: - YYDEBUG(1011, *YYCURSOR); yyaccept = 23; yych = *(YYMARKER = ++YYCURSOR); if (yych != '.') goto yy842; - YYDEBUG(1012, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; yy1013: - YYDEBUG(1013, *YYCURSOR); yyaccept = 23; YYMARKER = ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 9) YYFILL(9); yych = *YYCURSOR; - YYDEBUG(1014, *YYCURSOR); if (yych <= '-') { if (yych == '+') goto yy1016; if (yych <= ',') goto yy842; @@ -15005,12 +13970,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'G') goto yy842; } } - YYDEBUG(1015, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy1022; goto yy56; yy1016: - YYDEBUG(1016, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy1017; @@ -15018,14 +13981,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy1019; goto yy56; yy1017: - YYDEBUG(1017, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy842; if (yych <= '9') goto yy1019; if (yych <= ':') goto yy1020; goto yy842; yy1018: - YYDEBUG(1018, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '5') { if (yych <= '/') goto yy842; @@ -15036,41 +13997,34 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy842; } yy1019: - YYDEBUG(1019, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy842; if (yych <= '5') goto yy1021; if (yych <= '9') goto yy841; if (yych >= ';') goto yy842; yy1020: - YYDEBUG(1020, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy842; if (yych <= '5') goto yy1021; if (yych <= '9') goto yy841; goto yy842; yy1021: - YYDEBUG(1021, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy842; if (yych <= '9') goto yy841; goto yy842; yy1022: - YYDEBUG(1022, *YYCURSOR); yych = *++YYCURSOR; if (yych != 'T') goto yy56; - YYDEBUG(1023, *YYCURSOR); yych = *++YYCURSOR; if (yych == '+') goto yy1016; if (yych == '-') goto yy1016; goto yy56; yy1024: - YYDEBUG(1024, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy1025; if (yych != 'c') goto yy56; yy1025: - YYDEBUG(1025, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -15082,12 +14036,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1026: - YYDEBUG(1026, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'V') goto yy1027; if (yych != 'v') goto yy56; yy1027: - YYDEBUG(1027, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -15099,12 +14051,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1028: - YYDEBUG(1028, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy1029; if (yych != 't') goto yy56; yy1029: - YYDEBUG(1029, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { @@ -15116,12 +14066,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1030: - YYDEBUG(1030, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'P') goto yy1031; if (yych != 'p') goto yy56; yy1031: - YYDEBUG(1031, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -15132,7 +14080,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 't') goto yy793; } yy1032: - YYDEBUG(1032, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -15144,18 +14091,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1033: - YYDEBUG(1033, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'G') goto yy1036; if (yych == 'g') goto yy1036; goto yy56; yy1034: - YYDEBUG(1034, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy1035; if (yych != 'r') goto yy56; yy1035: - YYDEBUG(1035, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'H') { @@ -15167,7 +14111,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1036: - YYDEBUG(1036, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -15179,7 +14122,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1037: - YYDEBUG(1037, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych == 'R') goto yy1038; @@ -15194,7 +14136,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1038: - YYDEBUG(1038, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'B') { @@ -15206,18 +14147,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1039: - YYDEBUG(1039, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych == '-') goto yy766; goto yy793; yy1040: - YYDEBUG(1040, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'B') goto yy1041; if (yych != 'b') goto yy56; yy1041: - YYDEBUG(1041, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -15229,7 +14167,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1042: - YYDEBUG(1042, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych == 'L') goto yy1046; @@ -15245,12 +14182,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1043: - YYDEBUG(1043, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy1044; if (yych != 'n') goto yy56; yy1044: - YYDEBUG(1044, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -15262,7 +14197,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1045: - YYDEBUG(1045, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -15274,7 +14208,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1046: - YYDEBUG(1046, *YYCURSOR); yyaccept = 20; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'X') { @@ -15286,7 +14219,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy793; } yy1047: - YYDEBUG(1047, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '.') { if (yych <= '\t') { @@ -15308,7 +14240,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1048: - YYDEBUG(1048, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'P') { if (yych == 'C') goto yy128; @@ -15324,7 +14255,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1049: - YYDEBUG(1049, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '9') { if (yych <= ',') { @@ -15348,9 +14278,7 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1050: - YYDEBUG(1050, *YYCURSOR); yych = *++YYCURSOR; - YYDEBUG(-1, yych); switch (yych) { case '0': goto yy1054; case '1': goto yy1055; @@ -15381,7 +14309,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy577; } yy1051: - YYDEBUG(1051, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy1053; if (yych <= '0') goto yy735; @@ -15389,13 +14316,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy737; goto yy1053; yy1052: - YYDEBUG(1052, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 13) YYFILL(13); yych = *YYCURSOR; yy1053: - YYDEBUG(1053, *YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': case ' ': goto yy1052; @@ -15431,7 +14355,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy56; } yy1054: - YYDEBUG(1054, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '.') { if (yych <= ',') goto yy56; @@ -15443,7 +14366,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy1055: - YYDEBUG(1055, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '.') { if (yych <= ',') goto yy56; @@ -15454,14 +14376,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych >= '3') goto yy56; } yy1056: - YYDEBUG(1056, *YYCURSOR); yych = *++YYCURSOR; if (yych <= ',') goto yy56; if (yych <= '-') goto yy1057; if (yych <= '.') goto yy601; goto yy56; yy1057: - YYDEBUG(1057, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '2') { if (yych <= '/') goto yy56; @@ -15471,7 +14391,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy658; goto yy56; } - YYDEBUG(1058, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -15490,7 +14409,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1059: - YYDEBUG(1059, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -15509,7 +14427,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1060: - YYDEBUG(1060, *YYCURSOR); yyaccept = 13; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -15531,7 +14448,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1061: - YYDEBUG(1061, *YYCURSOR); yyaccept = 15; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'n') { @@ -15550,7 +14466,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1062: - YYDEBUG(1062, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '9') { if (yych <= '-') { @@ -15576,7 +14491,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1063: - YYDEBUG(1063, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '1') { if (yych <= '/') goto yy577; @@ -15588,22 +14502,18 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy577; } yy1064: - YYDEBUG(1064, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy1082; if (yych <= '9') goto yy1083; goto yy56; yy1065: - YYDEBUG(1065, *YYCURSOR); yych = *++YYCURSOR; if (yych == '-') goto yy784; if (yych <= '/') goto yy60; if (yych >= ':') goto yy60; - YYDEBUG(1066, *YYCURSOR); yyaccept = 24; yych = *(YYMARKER = ++YYCURSOR); - YYDEBUG(-1, yych); switch (yych) { case '\t': case ' ': @@ -15651,7 +14561,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) default: goto yy1067; } yy1067: - YYDEBUG(1067, *YYCURSOR); #line 1157 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("gnunocolon"); @@ -15674,29 +14583,25 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_GNU_NOCOLON; } -#line 15678 "ext/date/lib/parse_date.c" +#line 14587 "" yy1068: - YYDEBUG(1068, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '0') goto yy1080; if (yych <= '9') goto yy1081; goto yy60; yy1069: - YYDEBUG(1069, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '2') goto yy1079; if (yych <= '9') goto yy1078; goto yy60; yy1070: - YYDEBUG(1070, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '9') goto yy1078; goto yy60; yy1071: - YYDEBUG(1071, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '5') goto yy1076; @@ -15704,20 +14609,17 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy1074; goto yy60; yy1072: - YYDEBUG(1072, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '9') goto yy1074; goto yy60; yy1073: - YYDEBUG(1073, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy60; if (yych <= '0') goto yy1074; if (yych <= '9') goto yy54; goto yy60; yy1074: - YYDEBUG(1074, *YYCURSOR); yyaccept = 25; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 2) { @@ -15765,7 +14667,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1075: - YYDEBUG(1075, *YYCURSOR); #line 1203 "ext/date/lib/parse_date.re" { int tz_not_found; @@ -15785,9 +14686,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_ISO_NOCOLON; } -#line 15789 "ext/date/lib/parse_date.c" +#line 14690 "" yy1076: - YYDEBUG(1076, *YYCURSOR); yyaccept = 25; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -15850,7 +14750,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1077: - YYDEBUG(1077, *YYCURSOR); yyaccept = 25; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -15917,7 +14816,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1078: - YYDEBUG(1078, *YYCURSOR); yyaccept = 25; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -15980,7 +14878,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1079: - YYDEBUG(1079, *YYCURSOR); yyaccept = 25; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -16056,7 +14953,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1080: - YYDEBUG(1080, *YYCURSOR); yyaccept = 25; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -16132,7 +15028,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1081: - YYDEBUG(1081, *YYCURSOR); yyaccept = 25; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -16208,7 +15103,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1082: - YYDEBUG(1082, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -16220,13 +15114,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy1083: - YYDEBUG(1083, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy1084; if (yych != ':') goto yy490; yy1084: - YYDEBUG(1084, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy1085; @@ -16234,7 +15126,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy495; goto yy56; yy1085: - YYDEBUG(1085, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy496; @@ -16242,14 +15133,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy495; goto yy490; yy1086: - YYDEBUG(1086, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy496; if (yych == '0') goto yy495; goto yy490; yy1087: - YYDEBUG(1087, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -16263,7 +15152,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy1088: - YYDEBUG(1088, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -16278,7 +15166,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy1089: - YYDEBUG(1089, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -16292,7 +15179,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy1090: - YYDEBUG(1090, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -16303,7 +15189,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy1091: - YYDEBUG(1091, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '5') goto yy1092; @@ -16311,7 +15196,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy609; goto yy56; yy1092: - YYDEBUG(1092, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy496; @@ -16319,7 +15203,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy1094; goto yy490; yy1093: - YYDEBUG(1093, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -16331,7 +15214,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy490; } yy1094: - YYDEBUG(1094, *YYCURSOR); yyaccept = 11; yych = *(YYMARKER = ++YYCURSOR); if (yych == '.') goto yy496; @@ -16339,7 +15221,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy604; goto yy490; yy1095: - YYDEBUG(1095, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '9') { if (yych <= '-') { @@ -16365,7 +15246,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1096: - YYDEBUG(1096, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '9') { if (yych <= '-') { @@ -16391,7 +15271,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1097: - YYDEBUG(1097, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -16413,7 +15292,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1098: - YYDEBUG(1098, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'V') { if (yych <= ')') { @@ -16435,7 +15313,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1099: - YYDEBUG(1099, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'I') { if (yych <= ')') { @@ -16457,7 +15334,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1100: - YYDEBUG(1100, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= ')') { @@ -16479,7 +15355,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1101: - YYDEBUG(1101, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -16490,22 +15365,18 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'u') goto yy3; } yy1102: - YYDEBUG(1102, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy1103; if (yych != 's') goto yy56; yy1103: - YYDEBUG(1103, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\t') goto yy1104; if (yych != ' ') goto yy56; yy1104: - YYDEBUG(1104, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11); yych = *YYCURSOR; yy1105: - YYDEBUG(1105, *YYCURSOR); if (yych <= 'W') { if (yych <= 'F') { if (yych <= ' ') { @@ -16564,7 +15435,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1106: - YYDEBUG(1106, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= 'D') { @@ -16586,7 +15456,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1107: - YYDEBUG(1107, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych == 'I') goto yy1169; @@ -16602,19 +15471,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1108: - YYDEBUG(1108, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy1166; if (yych == 'o') goto yy1166; goto yy56; yy1109: - YYDEBUG(1109, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1165; if (yych == 'a') goto yy1165; goto yy56; yy1110: - YYDEBUG(1110, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych == 'O') goto yy1150; @@ -16630,19 +15496,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1111: - YYDEBUG(1111, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1146; if (yych == 'e') goto yy1146; goto yy56; yy1112: - YYDEBUG(1112, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1132; if (yych == 'e') goto yy1132; goto yy56; yy1113: - YYDEBUG(1113, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych == 'H') goto yy1114; @@ -16657,18 +15520,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1114: - YYDEBUG(1114, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'U') goto yy1127; if (yych == 'u') goto yy1127; goto yy56; yy1115: - YYDEBUG(1115, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1116; if (yych != 'e') goto yy56; yy1116: - YYDEBUG(1116, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ' ') { @@ -16682,7 +15542,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1117: - YYDEBUG(1117, *YYCURSOR); #line 1599 "ext/date/lib/parse_date.re" { timelib_sll i; @@ -16699,13 +15558,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 16703 "ext/date/lib/parse_date.c" +#line 15562 "" yy1118: - YYDEBUG(1118, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 2) YYFILL(2); yych = *YYCURSOR; - YYDEBUG(1119, *YYCURSOR); if (yych <= ' ') { if (yych == '\t') goto yy1118; if (yych <= 0x1F) goto yy56; @@ -16720,36 +15577,29 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1120: - YYDEBUG(1120, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy1121; if (yych != 'd') goto yy56; yy1121: - YYDEBUG(1121, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1122; if (yych != 'a') goto yy56; yy1122: - YYDEBUG(1122, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1123; if (yych != 'y') goto yy56; yy1123: - YYDEBUG(1123, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych == '\t') goto yy1118; if (yych == ' ') goto yy1118; goto yy1117; yy1124: - YYDEBUG(1124, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'F') goto yy1125; if (yych != 'f') goto yy56; yy1125: - YYDEBUG(1125, *YYCURSOR); ++YYCURSOR; - YYDEBUG(1126, *YYCURSOR); #line 1072 "ext/date/lib/parse_date.re" { timelib_sll i; @@ -16771,9 +15621,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_WEEK_DAY_OF_MONTH; } -#line 16775 "ext/date/lib/parse_date.c" +#line 15625 "" yy1127: - YYDEBUG(1127, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ' ') { @@ -16787,28 +15636,23 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'r') goto yy1117; } } - YYDEBUG(1128, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy1129; if (yych != 's') goto yy56; yy1129: - YYDEBUG(1129, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy1130; if (yych != 'd') goto yy56; yy1130: - YYDEBUG(1130, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1131; if (yych != 'a') goto yy56; yy1131: - YYDEBUG(1131, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1123; if (yych == 'y') goto yy1123; goto yy56; yy1132: - YYDEBUG(1132, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= 'C') goto yy56; @@ -16818,13 +15662,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 'd') goto yy1134; if (yych >= 'f') goto yy56; } - YYDEBUG(1133, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'K') goto yy1140; if (yych == 'k') goto yy1140; goto yy56; yy1134: - YYDEBUG(1134, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ' ') { @@ -16838,33 +15680,27 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'n') goto yy1117; } } - YYDEBUG(1135, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1136; if (yych != 'e') goto yy56; yy1136: - YYDEBUG(1136, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy1137; if (yych != 's') goto yy56; yy1137: - YYDEBUG(1137, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy1138; if (yych != 'd') goto yy56; yy1138: - YYDEBUG(1138, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1139; if (yych != 'a') goto yy56; yy1139: - YYDEBUG(1139, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1123; if (yych == 'y') goto yy1123; goto yy56; yy1140: - YYDEBUG(1140, *YYCURSOR); yyaccept = 27; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -16878,7 +15714,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1141: - YYDEBUG(1141, *YYCURSOR); #line 1575 "ext/date/lib/parse_date.re" { timelib_sll i; @@ -16902,61 +15737,50 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 16906 "ext/date/lib/parse_date.c" +#line 15741 "" yy1142: - YYDEBUG(1142, *YYCURSOR); yych = *++YYCURSOR; goto yy1117; yy1143: - YYDEBUG(1143, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1144; if (yych != 'a') goto yy56; yy1144: - YYDEBUG(1144, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1145; if (yych != 'y') goto yy56; yy1145: - YYDEBUG(1145, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy1142; if (yych == 's') goto yy1142; goto yy1117; yy1146: - YYDEBUG(1146, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1147; if (yych != 'a') goto yy56; yy1147: - YYDEBUG(1147, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy1148; if (yych != 'r') goto yy56; yy1148: - YYDEBUG(1148, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy1142; if (yych == 's') goto yy1142; goto yy1117; yy1149: - YYDEBUG(1149, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy1162; if (yych == 'i') goto yy1162; goto yy56; yy1150: - YYDEBUG(1150, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy1151; if (yych != 'r') goto yy56; yy1151: - YYDEBUG(1151, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy1152; if (yych != 't') goto yy56; yy1152: - YYDEBUG(1152, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych == 'H') goto yy1154; @@ -16969,55 +15793,45 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'n') goto yy56; } } - YYDEBUG(1153, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy1159; if (yych == 'i') goto yy1159; goto yy56; yy1154: - YYDEBUG(1154, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy1155; if (yych != 'n') goto yy56; yy1155: - YYDEBUG(1155, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'I') goto yy1156; if (yych != 'i') goto yy56; yy1156: - YYDEBUG(1156, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'G') goto yy1157; if (yych != 'g') goto yy56; yy1157: - YYDEBUG(1157, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'H') goto yy1158; if (yych != 'h') goto yy56; yy1158: - YYDEBUG(1158, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy1148; if (yych == 't') goto yy1148; goto yy56; yy1159: - YYDEBUG(1159, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'G') goto yy1160; if (yych != 'g') goto yy56; yy1160: - YYDEBUG(1160, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'H') goto yy1161; if (yych != 'h') goto yy56; yy1161: - YYDEBUG(1161, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy1148; if (yych == 't') goto yy1148; goto yy56; yy1162: - YYDEBUG(1162, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ' ') { @@ -17031,46 +15845,38 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'd') goto yy1117; } } - YYDEBUG(1163, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1164; if (yych != 'a') goto yy56; yy1164: - YYDEBUG(1164, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1123; if (yych == 'y') goto yy1123; goto yy56; yy1165: - YYDEBUG(1165, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1148; if (yych == 'y') goto yy1148; goto yy56; yy1166: - YYDEBUG(1166, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'U') goto yy1167; if (yych != 'u') goto yy56; yy1167: - YYDEBUG(1167, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy1148; if (yych == 'r') goto yy1148; goto yy56; yy1168: - YYDEBUG(1168, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy1173; if (yych == 'n') goto yy1173; goto yy56; yy1169: - YYDEBUG(1169, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy1170; if (yych != 'n') goto yy56; yy1170: - YYDEBUG(1170, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'U') { @@ -17084,18 +15890,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'u') goto yy1117; } } - YYDEBUG(1171, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy1172; if (yych != 't') goto yy56; yy1172: - YYDEBUG(1172, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1148; if (yych == 'e') goto yy1148; goto yy56; yy1173: - YYDEBUG(1173, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -17117,42 +15920,35 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1174: - YYDEBUG(1174, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1176; if (yych == 'a') goto yy1176; goto yy56; yy1175: - YYDEBUG(1175, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'H') goto yy1148; if (yych == 'h') goto yy1148; goto yy56; yy1176: - YYDEBUG(1176, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1123; if (yych == 'y') goto yy1123; goto yy56; yy1177: - YYDEBUG(1177, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy1188; if (yych == 'n') goto yy1188; goto yy56; yy1178: - YYDEBUG(1178, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy1183; if (yych == 't') goto yy1183; goto yy56; yy1179: - YYDEBUG(1179, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'C') goto yy1180; if (yych != 'c') goto yy56; yy1180: - YYDEBUG(1180, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -17168,18 +15964,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1181: - YYDEBUG(1181, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'N') goto yy1182; if (yych != 'n') goto yy56; yy1182: - YYDEBUG(1182, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy1148; if (yych == 'd') goto yy1148; goto yy56; yy1183: - YYDEBUG(1183, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ' ') { @@ -17193,28 +15986,23 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'u') goto yy1117; } } - YYDEBUG(1184, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy1185; if (yych != 'r') goto yy56; yy1185: - YYDEBUG(1185, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy1186; if (yych != 'd') goto yy56; yy1186: - YYDEBUG(1186, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1187; if (yych != 'a') goto yy56; yy1187: - YYDEBUG(1187, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1123; if (yych == 'y') goto yy1123; goto yy56; yy1188: - YYDEBUG(1188, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ' ') { @@ -17228,18 +16016,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'd') goto yy1117; } } - YYDEBUG(1189, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1190; if (yych != 'a') goto yy56; yy1190: - YYDEBUG(1190, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1123; if (yych == 'y') goto yy1123; goto yy56; yy1191: - YYDEBUG(1191, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -17270,7 +16055,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1192: - YYDEBUG(1192, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'U') { @@ -17301,7 +16085,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1193: - YYDEBUG(1193, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'H') { @@ -17332,7 +16115,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1194: - YYDEBUG(1194, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { @@ -17363,7 +16145,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1195: - YYDEBUG(1195, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -17387,11 +16168,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1196: - YYDEBUG(1196, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'S') goto yy1103; if (yych != 's') goto yy154; - YYDEBUG(1197, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 16) { goto yy153; @@ -17414,7 +16193,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1198: - YYDEBUG(1198, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'G') { if (yych <= ')') { @@ -17437,7 +16215,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1199: - YYDEBUG(1199, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -17459,7 +16236,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1200: - YYDEBUG(1200, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'V') { if (yych <= ')') { @@ -17481,7 +16257,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1201: - YYDEBUG(1201, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -17503,7 +16278,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1202: - YYDEBUG(1202, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -17525,7 +16299,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1203: - YYDEBUG(1203, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -17536,22 +16309,18 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 't') goto yy3; } yy1204: - YYDEBUG(1204, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'H') goto yy1205; if (yych != 'h') goto yy56; yy1205: - YYDEBUG(1205, *YYCURSOR); yych = *++YYCURSOR; if (yych == '\t') goto yy1206; if (yych != ' ') goto yy56; yy1206: - YYDEBUG(1206, *YYCURSOR); ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 11) YYFILL(11); yych = *YYCURSOR; yy1207: - YYDEBUG(1207, *YYCURSOR); if (yych <= 'W') { if (yych <= 'F') { if (yych <= ' ') { @@ -17609,12 +16378,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } } - YYDEBUG(1208, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1209; if (yych != 'e') goto yy56; yy1209: - YYDEBUG(1209, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= 'C') goto yy56; @@ -17624,12 +16391,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 'd') goto yy1134; if (yych >= 'f') goto yy56; } - YYDEBUG(1210, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'K') goto yy1211; if (yych != 'k') goto yy56; yy1211: - YYDEBUG(1211, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych == 'D') goto yy1143; @@ -17645,7 +16410,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1212: - YYDEBUG(1212, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'H') { if (yych <= ')') { @@ -17667,7 +16431,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1213: - YYDEBUG(1213, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -17689,7 +16452,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1214: - YYDEBUG(1214, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -17713,7 +16475,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1215: - YYDEBUG(1215, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 0x1F) { @@ -17725,7 +16486,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy1216: - YYDEBUG(1216, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'F') { @@ -17756,7 +16516,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1217: - YYDEBUG(1217, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -17787,7 +16546,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1218: - YYDEBUG(1218, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'U') { @@ -17818,7 +16576,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1219: - YYDEBUG(1219, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -17849,7 +16606,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1220: - YYDEBUG(1220, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -17880,7 +16636,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1221: - YYDEBUG(1221, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -17904,12 +16659,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1222: - YYDEBUG(1222, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'H') goto yy1205; if (yych != 'h') goto yy154; yy1223: - YYDEBUG(1223, *YYCURSOR); yych = *++YYCURSOR; if (yybm[0+yych] & 16) { goto yy153; @@ -17932,7 +16685,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1224: - YYDEBUG(1224, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -17963,7 +16715,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1225: - YYDEBUG(1225, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -17994,7 +16745,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1226: - YYDEBUG(1226, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -18038,7 +16788,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1227: - YYDEBUG(1227, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { @@ -18064,7 +16813,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1228: - YYDEBUG(1228, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'V') { if (yych <= 'B') { @@ -18102,7 +16850,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1229: - YYDEBUG(1229, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -18125,7 +16872,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1230: - YYDEBUG(1230, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'X') { if (yych <= ')') { @@ -18148,7 +16894,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1231: - YYDEBUG(1231, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -18170,7 +16915,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1232: - YYDEBUG(1232, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= ')') { @@ -18192,7 +16936,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1233: - YYDEBUG(1233, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -18208,7 +16951,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1234: - YYDEBUG(1234, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych <= ')') { @@ -18230,12 +16972,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1235: - YYDEBUG(1235, *YYCURSOR); yych = *++YYCURSOR; if (yych == ')') goto yy139; goto yy166; yy1236: - YYDEBUG(1236, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -18257,7 +16997,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1237: - YYDEBUG(1237, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'H') { if (yych <= ')') { @@ -18279,7 +17018,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1238: - YYDEBUG(1238, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '(') { @@ -18302,7 +17040,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1239: - YYDEBUG(1239, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= ')') { @@ -18324,7 +17061,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1240: - YYDEBUG(1240, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= ')') { @@ -18346,7 +17082,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1241: - YYDEBUG(1241, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= ')') { @@ -18368,7 +17103,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1242: - YYDEBUG(1242, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -18379,13 +17113,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'a') goto yy3; } yy1243: - YYDEBUG(1243, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy172; if (yych == 'y') goto yy172; goto yy56; yy1244: - YYDEBUG(1244, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= ')') { @@ -18408,7 +17140,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1245: - YYDEBUG(1245, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -18431,7 +17162,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1246: - YYDEBUG(1246, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -18473,7 +17203,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1247: - YYDEBUG(1247, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -18515,7 +17244,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1248: - YYDEBUG(1248, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'M') { if (yych <= ')') { @@ -18537,7 +17265,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1249: - YYDEBUG(1249, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'A') { @@ -18548,18 +17275,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'b') goto yy3; } yy1250: - YYDEBUG(1250, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1251; if (yych != 'e') goto yy56; yy1251: - YYDEBUG(1251, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy205; if (yych == 'r') goto yy205; goto yy56; yy1252: - YYDEBUG(1252, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -18581,7 +17305,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1253: - YYDEBUG(1253, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -18603,7 +17326,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1254: - YYDEBUG(1254, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -18615,7 +17337,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy1255: - YYDEBUG(1255, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -18637,7 +17358,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1256: - YYDEBUG(1256, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= ')') { @@ -18660,7 +17380,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1257: - YYDEBUG(1257, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'U') { @@ -18706,7 +17425,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1258: - YYDEBUG(1258, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -18737,7 +17455,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1259: - YYDEBUG(1259, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'W') { @@ -18768,7 +17485,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1260: - YYDEBUG(1260, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -18799,7 +17515,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1261: - YYDEBUG(1261, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -18830,7 +17545,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1262: - YYDEBUG(1262, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -18856,7 +17570,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1263: - YYDEBUG(1263, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'X') { @@ -18887,7 +17600,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1264: - YYDEBUG(1264, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { @@ -18907,7 +17619,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1265: - YYDEBUG(1265, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -18938,7 +17649,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1266: - YYDEBUG(1266, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -18969,7 +17679,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1267: - YYDEBUG(1267, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '-') { @@ -18999,7 +17708,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1268: - YYDEBUG(1268, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -19030,7 +17738,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1269: - YYDEBUG(1269, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -19061,7 +17768,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1270: - YYDEBUG(1270, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -19092,7 +17798,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1271: - YYDEBUG(1271, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -19117,13 +17822,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1272: - YYDEBUG(1272, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy172; if (yych == 'y') goto yy185; goto yy154; yy1273: - YYDEBUG(1273, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { @@ -19154,7 +17857,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1274: - YYDEBUG(1274, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -19185,7 +17887,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1275: - YYDEBUG(1275, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -19230,7 +17931,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1276: - YYDEBUG(1276, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -19275,7 +17975,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1277: - YYDEBUG(1277, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'L') { @@ -19306,7 +18005,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1278: - YYDEBUG(1278, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'A') { @@ -19330,17 +18028,14 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1279: - YYDEBUG(1279, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'E') goto yy1251; if (yych != 'e') goto yy154; - YYDEBUG(1280, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy205; if (yych == 'r') goto yy376; goto yy154; yy1281: - YYDEBUG(1281, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -19371,7 +18066,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1282: - YYDEBUG(1282, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -19402,7 +18096,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1283: - YYDEBUG(1283, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -19426,7 +18119,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1284: - YYDEBUG(1284, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -19457,7 +18149,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1285: - YYDEBUG(1285, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -19488,7 +18179,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1286: - YYDEBUG(1286, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'C') { if (yych <= ')') { @@ -19510,7 +18200,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1287: - YYDEBUG(1287, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'K') { if (yych <= ')') { @@ -19532,7 +18221,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1288: - YYDEBUG(1288, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ')') { @@ -19550,20 +18238,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1289: - YYDEBUG(1289, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy1290; if (yych != 'o') goto yy56; yy1290: - YYDEBUG(1290, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'F') goto yy1291; if (yych != 'f') goto yy56; yy1291: - YYDEBUG(1291, *YYCURSOR); yych = *++YYCURSOR; if (yych != ' ') goto yy56; - YYDEBUG(1292, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy1293; @@ -19571,14 +18255,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy1296; goto yy56; yy1293: - YYDEBUG(1293, *YYCURSOR); yyaccept = 28; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy1297; if (yych <= '9') goto yy1296; goto yy1297; yy1294: - YYDEBUG(1294, *YYCURSOR); #line 1049 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("backof | frontof"); @@ -19601,21 +18283,18 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 19605 "ext/date/lib/parse_date.c" +#line 18287 "" yy1295: - YYDEBUG(1295, *YYCURSOR); yyaccept = 28; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy1297; if (yych >= '5') goto yy1297; yy1296: - YYDEBUG(1296, *YYCURSOR); yyaccept = 28; YYMARKER = ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = *YYCURSOR; yy1297: - YYDEBUG(1297, *YYCURSOR); if (yych <= 'A') { if (yych <= 0x1F) { if (yych == '\t') goto yy1296; @@ -19633,7 +18312,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1298: - YYDEBUG(1298, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych != '.') goto yy56; @@ -19642,12 +18320,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych == 'm') goto yy1300; goto yy56; } - YYDEBUG(1299, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy1300; if (yych != 'm') goto yy56; yy1300: - YYDEBUG(1300, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x00) goto yy1302; @@ -19657,7 +18333,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ' ') goto yy1302; if (yych != '.') goto yy56; } - YYDEBUG(1301, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\t') { if (yych <= 0x00) goto yy1302; @@ -19666,11 +18341,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != ' ') goto yy56; } yy1302: - YYDEBUG(1302, *YYCURSOR); yych = *++YYCURSOR; goto yy1294; yy1303: - YYDEBUG(1303, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'B') { @@ -19701,7 +18374,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1304: - YYDEBUG(1304, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'J') { @@ -19732,7 +18404,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1305: - YYDEBUG(1305, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -19758,7 +18429,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1306: - YYDEBUG(1306, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= ')') { @@ -19780,7 +18450,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1307: - YYDEBUG(1307, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -19802,7 +18471,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1308: - YYDEBUG(1308, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '(') { @@ -19824,22 +18492,18 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1309: - YYDEBUG(1309, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy1310; if (yych != 'd') goto yy1105; yy1310: - YYDEBUG(1310, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1311; if (yych != 'a') goto yy56; yy1311: - YYDEBUG(1311, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1312; if (yych != 'y') goto yy56; yy1312: - YYDEBUG(1312, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'R') { @@ -19849,19 +18513,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych == 's') goto yy1142; goto yy1117; } - YYDEBUG(1313, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy1314; if (yych != 'o') goto yy56; yy1314: - YYDEBUG(1314, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'F') goto yy1315; if (yych != 'f') goto yy56; yy1315: - YYDEBUG(1315, *YYCURSOR); ++YYCURSOR; - YYDEBUG(1316, *YYCURSOR); #line 1032 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("firstdayof | lastdayof"); @@ -19878,9 +18538,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_LF_DAY_OF_MONTH; } -#line 19882 "ext/date/lib/parse_date.c" +#line 18542 "" yy1317: - YYDEBUG(1317, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'R') { @@ -19911,7 +18570,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1318: - YYDEBUG(1318, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -19942,7 +18600,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1319: - YYDEBUG(1319, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '-') { @@ -19972,7 +18629,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1320: - YYDEBUG(1320, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'B') { if (yych <= ')') { @@ -19995,7 +18651,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1321: - YYDEBUG(1321, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= '@') { @@ -20019,7 +18674,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1322: - YYDEBUG(1322, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= ')') { @@ -20042,7 +18696,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1323: - YYDEBUG(1323, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= '@') { @@ -20065,7 +18718,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1324: - YYDEBUG(1324, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -20088,7 +18740,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1325: - YYDEBUG(1325, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= ')') { @@ -20110,7 +18761,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1326: - YYDEBUG(1326, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -20126,7 +18776,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1327: - YYDEBUG(1327, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych <= ')') { @@ -20149,7 +18798,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1328: - YYDEBUG(1328, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -20171,7 +18819,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1329: - YYDEBUG(1329, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= ')') { @@ -20189,20 +18836,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1330: - YYDEBUG(1330, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy1331; if (yych != 'o') goto yy56; yy1331: - YYDEBUG(1331, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'F') goto yy1332; if (yych != 'f') goto yy56; yy1332: - YYDEBUG(1332, *YYCURSOR); yych = *++YYCURSOR; if (yych != ' ') goto yy56; - YYDEBUG(1333, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '1') goto yy1334; @@ -20210,26 +18853,22 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '9') goto yy1336; goto yy56; yy1334: - YYDEBUG(1334, *YYCURSOR); yyaccept = 28; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy1337; if (yych <= '9') goto yy1336; goto yy1337; yy1335: - YYDEBUG(1335, *YYCURSOR); yyaccept = 28; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy1337; if (yych >= '5') goto yy1337; yy1336: - YYDEBUG(1336, *YYCURSOR); yyaccept = 28; YYMARKER = ++YYCURSOR; if ((YYLIMIT - YYCURSOR) < 5) YYFILL(5); yych = *YYCURSOR; yy1337: - YYDEBUG(1337, *YYCURSOR); if (yych <= 'A') { if (yych <= 0x1F) { if (yych == '\t') goto yy1336; @@ -20247,7 +18886,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1338: - YYDEBUG(1338, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych != '.') goto yy56; @@ -20256,12 +18894,10 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych == 'm') goto yy1340; goto yy56; } - YYDEBUG(1339, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'M') goto yy1340; if (yych != 'm') goto yy56; yy1340: - YYDEBUG(1340, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 0x1F) { if (yych <= 0x00) goto yy1302; @@ -20271,7 +18907,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= ' ') goto yy1302; if (yych != '.') goto yy56; } - YYDEBUG(1341, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '\t') { if (yych <= 0x00) goto yy1302; @@ -20282,7 +18917,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy1342: - YYDEBUG(1342, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= ')') { @@ -20304,7 +18938,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1343: - YYDEBUG(1343, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -20326,7 +18959,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1344: - YYDEBUG(1344, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'H') { if (yych <= ')') { @@ -20349,7 +18981,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1345: - YYDEBUG(1345, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= ')') { @@ -20372,7 +19003,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1346: - YYDEBUG(1346, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -20394,7 +19024,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1347: - YYDEBUG(1347, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'H') { if (yych <= ')') { @@ -20417,7 +19046,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1348: - YYDEBUG(1348, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -20439,7 +19067,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1349: - YYDEBUG(1349, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '(') { @@ -20461,22 +19088,18 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1350: - YYDEBUG(1350, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'D') goto yy1351; if (yych != 'd') goto yy1207; yy1351: - YYDEBUG(1351, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1352; if (yych != 'a') goto yy56; yy1352: - YYDEBUG(1352, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1353; if (yych != 'y') goto yy56; yy1353: - YYDEBUG(1353, *YYCURSOR); yyaccept = 26; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'R') { @@ -20486,18 +19109,15 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych == 's') goto yy1142; goto yy1117; } - YYDEBUG(1354, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'O') goto yy1355; if (yych != 'o') goto yy56; yy1355: - YYDEBUG(1355, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'F') goto yy1315; if (yych == 'f') goto yy1315; goto yy56; yy1356: - YYDEBUG(1356, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -20539,7 +19159,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1357: - YYDEBUG(1357, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= ')') { @@ -20561,7 +19180,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1358: - YYDEBUG(1358, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -20577,7 +19195,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1359: - YYDEBUG(1359, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -20588,13 +19205,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'r') goto yy3; } yy1360: - YYDEBUG(1360, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy205; if (yych == 'y') goto yy205; goto yy56; yy1361: - YYDEBUG(1361, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'A') { @@ -20625,7 +19240,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1362: - YYDEBUG(1362, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -20667,7 +19281,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1363: - YYDEBUG(1363, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -20698,7 +19311,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1364: - YYDEBUG(1364, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { @@ -20740,7 +19352,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1365: - YYDEBUG(1365, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -20771,7 +19382,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1366: - YYDEBUG(1366, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -20802,7 +19412,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1367: - YYDEBUG(1367, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -20828,7 +19437,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1368: - YYDEBUG(1368, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'X') { @@ -20859,7 +19467,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1369: - YYDEBUG(1369, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -20890,7 +19497,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1370: - YYDEBUG(1370, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -20916,7 +19522,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1371: - YYDEBUG(1371, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -20947,7 +19552,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1372: - YYDEBUG(1372, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -20978,7 +19582,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1373: - YYDEBUG(1373, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -21009,7 +19612,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1374: - YYDEBUG(1374, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'R') { @@ -21040,7 +19642,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1375: - YYDEBUG(1375, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -21071,7 +19672,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1376: - YYDEBUG(1376, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -21102,7 +19702,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1377: - YYDEBUG(1377, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -21133,7 +19732,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1378: - YYDEBUG(1378, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '-') { @@ -21163,7 +19761,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1379: - YYDEBUG(1379, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -21208,7 +19805,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1380: - YYDEBUG(1380, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -21239,7 +19835,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1381: - YYDEBUG(1381, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -21265,7 +19860,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1382: - YYDEBUG(1382, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -21289,26 +19883,21 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1383: - YYDEBUG(1383, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy205; if (yych == 'y') goto yy376; goto yy154; yy1384: - YYDEBUG(1384, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; yy1385: - YYDEBUG(1385, *YYCURSOR); ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); yych = *YYCURSOR; - YYDEBUG(1386, *YYCURSOR); if (yych <= '/') goto yy1387; if (yych <= '9') goto yy1385; yy1387: - YYDEBUG(1387, *YYCURSOR); #line 1006 "ext/date/lib/parse_date.re" { timelib_ull i; @@ -21334,9 +19923,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21338 "ext/date/lib/parse_date.c" +#line 19927 "" yy1388: - YYDEBUG(1388, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -21359,7 +19947,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1389: - YYDEBUG(1389, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'U') { if (yych <= '@') { @@ -21383,7 +19970,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1390: - YYDEBUG(1390, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'M') { if (yych <= '@') { @@ -21407,7 +19993,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1391: - YYDEBUG(1391, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -21430,7 +20015,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1392: - YYDEBUG(1392, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -21453,7 +20037,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1393: - YYDEBUG(1393, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy1064; @@ -21464,7 +20047,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy1394: - YYDEBUG(1394, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy1064; @@ -21475,13 +20057,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy1395: - YYDEBUG(1395, *YYCURSOR); yych = *++YYCURSOR; if (yych == '.') goto yy1064; if (yych == ':') goto yy1064; goto yy56; yy1396: - YYDEBUG(1396, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') { if (yych == '.') goto yy1064; @@ -21492,11 +20072,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy56; } yy1397: - YYDEBUG(1397, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych >= ':') goto yy56; - YYDEBUG(1398, *YYCURSOR); yyaccept = 24; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') goto yy1067; @@ -21504,21 +20082,17 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= '6') goto yy1400; goto yy1067; yy1399: - YYDEBUG(1399, *YYCURSOR); yych = *++YYCURSOR; if (yych <= '/') goto yy56; if (yych <= '9') goto yy1401; goto yy56; yy1400: - YYDEBUG(1400, *YYCURSOR); yych = *++YYCURSOR; if (yych != '0') goto yy56; yy1401: - YYDEBUG(1401, *YYCURSOR); yych = *++YYCURSOR; goto yy1075; yy1402: - YYDEBUG(1402, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'L') { if (yych <= ')') { @@ -21540,7 +20114,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1403: - YYDEBUG(1403, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'F') { if (yych <= ')') { @@ -21562,7 +20135,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1404: - YYDEBUG(1404, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -21584,7 +20156,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1405: - YYDEBUG(1405, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -21596,7 +20167,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy1406: - YYDEBUG(1406, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= ')') { @@ -21618,7 +20188,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1407: - YYDEBUG(1407, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= ')') { @@ -21640,7 +20209,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1408: - YYDEBUG(1408, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -21656,7 +20224,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1409: - YYDEBUG(1409, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'X') { if (yych == ')') goto yy139; @@ -21667,7 +20234,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy3; } yy1410: - YYDEBUG(1410, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -21684,7 +20250,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1411: - YYDEBUG(1411, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'O') { if (yych <= ')') { @@ -21706,7 +20271,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1412: - YYDEBUG(1412, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= ')') { @@ -21728,7 +20292,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1413: - YYDEBUG(1413, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= ')') { @@ -21750,7 +20313,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1414: - YYDEBUG(1414, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { @@ -21761,15 +20323,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'o') goto yy3; } yy1415: - YYDEBUG(1415, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'W') goto yy1416; if (yych != 'w') goto yy56; yy1416: - YYDEBUG(1416, *YYCURSOR); ++YYCURSOR; yy1417: - YYDEBUG(1417, *YYCURSOR); #line 994 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("tomorrow"); @@ -21781,9 +20340,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21785 "ext/date/lib/parse_date.c" +#line 20344 "" yy1418: - YYDEBUG(1418, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych <= ')') { @@ -21805,7 +20363,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1419: - YYDEBUG(1419, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '@') { if (yych == ')') goto yy139; @@ -21815,7 +20372,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 'z') goto yy144; } yy1420: - YYDEBUG(1420, *YYCURSOR); #line 984 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("midnight | today"); @@ -21825,9 +20381,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 21829 "ext/date/lib/parse_date.c" +#line 20385 "" yy1421: - YYDEBUG(1421, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= '@') { @@ -21851,7 +20406,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1422: - YYDEBUG(1422, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= ')') { @@ -21873,7 +20427,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1423: - YYDEBUG(1423, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= ')') { @@ -21895,7 +20448,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1424: - YYDEBUG(1424, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= ')') { @@ -21917,7 +20469,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1425: - YYDEBUG(1425, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -21928,13 +20479,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'a') goto yy3; } yy1426: - YYDEBUG(1426, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy172; if (yych == 'y') goto yy172; goto yy56; yy1427: - YYDEBUG(1427, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= ')') { @@ -21957,7 +20506,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1428: - YYDEBUG(1428, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '(') { @@ -21980,7 +20528,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1429: - YYDEBUG(1429, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -22002,7 +20549,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1430: - YYDEBUG(1430, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'H') { if (yych <= ')') { @@ -22025,7 +20571,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1431: - YYDEBUG(1431, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -22056,7 +20601,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1432: - YYDEBUG(1432, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'T') { @@ -22098,7 +20642,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1433: - YYDEBUG(1433, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'L') { @@ -22140,7 +20683,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1434: - YYDEBUG(1434, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -22171,7 +20713,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1435: - YYDEBUG(1435, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -22202,7 +20743,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1436: - YYDEBUG(1436, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'K') { @@ -22233,7 +20773,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1437: - YYDEBUG(1437, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'E') { @@ -22264,7 +20803,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1438: - YYDEBUG(1438, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -22295,7 +20833,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1439: - YYDEBUG(1439, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -22319,7 +20856,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1440: - YYDEBUG(1440, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'R') { @@ -22350,7 +20886,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1441: - YYDEBUG(1441, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -22381,7 +20916,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1442: - YYDEBUG(1442, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -22407,7 +20941,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1443: - YYDEBUG(1443, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'X') { @@ -22431,7 +20964,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1444: - YYDEBUG(1444, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -22457,7 +20989,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1445: - YYDEBUG(1445, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { @@ -22488,7 +21019,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1446: - YYDEBUG(1446, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -22519,7 +21049,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1447: - YYDEBUG(1447, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -22550,7 +21079,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1448: - YYDEBUG(1448, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'N') { @@ -22574,11 +21102,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1449: - YYDEBUG(1449, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'W') goto yy1416; if (yych != 'w') goto yy154; - YYDEBUG(1450, *YYCURSOR); yyaccept = 29; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { @@ -22593,7 +21119,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy1417; } yy1451: - YYDEBUG(1451, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'X') { @@ -22624,7 +21149,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1452: - YYDEBUG(1452, *YYCURSOR); yyaccept = 30; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -22648,7 +21172,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1453: - YYDEBUG(1453, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'R') { @@ -22687,7 +21210,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1454: - YYDEBUG(1454, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -22718,7 +21240,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1455: - YYDEBUG(1455, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'R') { @@ -22749,7 +21270,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1456: - YYDEBUG(1456, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -22780,7 +21300,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1457: - YYDEBUG(1457, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -22805,13 +21324,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1458: - YYDEBUG(1458, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy172; if (yych == 'y') goto yy185; goto yy154; yy1459: - YYDEBUG(1459, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -22842,7 +21359,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1460: - YYDEBUG(1460, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '-') { @@ -22872,7 +21388,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1461: - YYDEBUG(1461, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -22903,7 +21418,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1462: - YYDEBUG(1462, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -22934,7 +21448,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1463: - YYDEBUG(1463, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych <= '@') { @@ -22958,7 +21471,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1464: - YYDEBUG(1464, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= ')') { @@ -22981,7 +21493,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1465: - YYDEBUG(1465, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -23003,7 +21514,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1466: - YYDEBUG(1466, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'D') { if (yych <= ')') { @@ -23025,7 +21535,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1467: - YYDEBUG(1467, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'A') { if (yych == ')') goto yy139; @@ -23041,7 +21550,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1468: - YYDEBUG(1468, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'Y') { if (yych <= ')') { @@ -23064,7 +21572,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1469: - YYDEBUG(1469, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -23086,7 +21593,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1470: - YYDEBUG(1470, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'I') { if (yych <= ')') { @@ -23108,7 +21614,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1471: - YYDEBUG(1471, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'G') { if (yych <= ')') { @@ -23130,7 +21635,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1472: - YYDEBUG(1472, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -23141,16 +21645,13 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'h') goto yy3; } yy1473: - YYDEBUG(1473, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy1474; if (yych != 't') goto yy56; yy1474: - YYDEBUG(1474, *YYCURSOR); yych = *++YYCURSOR; goto yy1420; yy1475: - YYDEBUG(1475, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -23193,7 +21694,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1476: - YYDEBUG(1476, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '-') { @@ -23219,7 +21719,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1477: - YYDEBUG(1477, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'H') { if (yych <= ')') { @@ -23242,7 +21741,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1478: - YYDEBUG(1478, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'X') { @@ -23284,7 +21782,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1479: - YYDEBUG(1479, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -23315,7 +21812,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1480: - YYDEBUG(1480, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -23346,7 +21842,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1481: - YYDEBUG(1481, *YYCURSOR); yyaccept = 4; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -23377,7 +21872,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1482: - YYDEBUG(1482, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '@') { @@ -23403,7 +21897,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1483: - YYDEBUG(1483, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'X') { @@ -23434,7 +21927,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1484: - YYDEBUG(1484, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -23465,7 +21957,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1485: - YYDEBUG(1485, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'H') { @@ -23496,7 +21987,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1486: - YYDEBUG(1486, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'F') { @@ -23527,7 +22017,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1487: - YYDEBUG(1487, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -23551,11 +22040,9 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1488: - YYDEBUG(1488, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'T') goto yy1474; if (yych != 't') goto yy154; - YYDEBUG(1489, *YYCURSOR); yyaccept = 30; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { @@ -23570,7 +22057,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) goto yy1420; } yy1490: - YYDEBUG(1490, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -23615,7 +22101,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1491: - YYDEBUG(1491, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '.') { @@ -23651,7 +22136,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1492: - YYDEBUG(1492, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -23682,7 +22166,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1493: - YYDEBUG(1493, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'W') { if (yych <= 'N') { @@ -23713,7 +22196,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1494: - YYDEBUG(1494, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'X') { if (yych <= ')') { @@ -23736,7 +22218,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1495: - YYDEBUG(1495, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -23758,7 +22239,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1496: - YYDEBUG(1496, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -23780,7 +22260,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1497: - YYDEBUG(1497, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'H') { if (yych <= ')') { @@ -23803,7 +22282,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1498: - YYDEBUG(1498, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -23826,7 +22304,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1499: - YYDEBUG(1499, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '@') { if (yych == ')') goto yy139; @@ -23836,7 +22313,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 'z') goto yy142; } yy1500: - YYDEBUG(1500, *YYCURSOR); #line 963 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("now"); @@ -23845,9 +22321,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 23849 "ext/date/lib/parse_date.c" +#line 22325 "" yy1501: - YYDEBUG(1501, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'N') { if (yych <= ')') { @@ -23870,7 +22345,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1502: - YYDEBUG(1502, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -23912,7 +22386,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1503: - YYDEBUG(1503, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'M') { if (yych <= ')') { @@ -23934,7 +22407,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1504: - YYDEBUG(1504, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'B') { if (yych <= ')') { @@ -23956,7 +22428,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1505: - YYDEBUG(1505, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -23967,13 +22438,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'e') goto yy3; } yy1506: - YYDEBUG(1506, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy205; if (yych == 'r') goto yy205; goto yy56; yy1507: - YYDEBUG(1507, *YYCURSOR); ++YYCURSOR; if ((yych = *YYCURSOR) <= '@') { if (yych == ')') goto yy139; @@ -23983,7 +22452,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych <= 'z') goto yy143; } yy1508: - YYDEBUG(1508, *YYCURSOR); #line 972 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("noon"); @@ -23995,9 +22463,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 23999 "ext/date/lib/parse_date.c" +#line 22467 "" yy1509: - YYDEBUG(1509, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'V') { @@ -24044,7 +22511,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1510: - YYDEBUG(1510, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'W') { @@ -24075,7 +22541,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1511: - YYDEBUG(1511, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -24106,7 +22571,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1512: - YYDEBUG(1512, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -24137,7 +22601,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1513: - YYDEBUG(1513, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'G') { @@ -24168,7 +22631,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1514: - YYDEBUG(1514, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -24199,7 +22661,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1515: - YYDEBUG(1515, *YYCURSOR); yyaccept = 31; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -24223,7 +22684,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1516: - YYDEBUG(1516, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'M') { @@ -24254,7 +22714,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1517: - YYDEBUG(1517, *YYCURSOR); yyaccept = 5; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '9') { @@ -24299,7 +22758,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1518: - YYDEBUG(1518, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'L') { @@ -24330,7 +22788,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1519: - YYDEBUG(1519, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'A') { @@ -24361,7 +22818,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1520: - YYDEBUG(1520, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -24385,13 +22841,11 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1521: - YYDEBUG(1521, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'R') goto yy205; if (yych == 'r') goto yy376; goto yy154; yy1522: - YYDEBUG(1522, *YYCURSOR); yyaccept = 32; yych = *(YYMARKER = ++YYCURSOR); if (yych <= '/') { @@ -24415,7 +22869,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1523: - YYDEBUG(1523, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'S') { if (yych <= ')') { @@ -24437,7 +22890,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1524: - YYDEBUG(1524, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'T') { if (yych <= ')') { @@ -24459,7 +22911,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1525: - YYDEBUG(1525, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'E') { if (yych <= ')') { @@ -24481,7 +22932,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1526: - YYDEBUG(1526, *YYCURSOR); yych = *++YYCURSOR; if (yych <= 'R') { if (yych <= ')') { @@ -24503,7 +22953,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1527: - YYDEBUG(1527, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -24514,20 +22963,16 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) if (yych != 'd') goto yy3; } yy1528: - YYDEBUG(1528, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1529; if (yych != 'a') goto yy56; yy1529: - YYDEBUG(1529, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1530; if (yych != 'y') goto yy56; yy1530: - YYDEBUG(1530, *YYCURSOR); ++YYCURSOR; yy1531: - YYDEBUG(1531, *YYCURSOR); #line 951 "ext/date/lib/parse_date.re" { DEBUG_OUTPUT("yesterday"); @@ -24539,9 +22984,8 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) TIMELIB_DEINIT; return TIMELIB_RELATIVE; } -#line 24543 "ext/date/lib/parse_date.c" +#line 22988 "" yy1532: - YYDEBUG(1532, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'R') { @@ -24572,7 +23016,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1533: - YYDEBUG(1533, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'S') { @@ -24603,7 +23046,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1534: - YYDEBUG(1534, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'D') { @@ -24634,7 +23076,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1535: - YYDEBUG(1535, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'Q') { @@ -24665,7 +23106,6 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1536: - YYDEBUG(1536, *YYCURSOR); yyaccept = 0; yych = *(YYMARKER = ++YYCURSOR); if (yych <= 'C') { @@ -24689,15 +23129,12 @@ static int scan(Scanner *s, timelib_tz_get_wrapper tz_get_wrapper) } } yy1537: - YYDEBUG(1537, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'A') goto yy1529; if (yych != 'a') goto yy154; - YYDEBUG(1538, *YYCURSOR); yych = *++YYCURSOR; if (yych == 'Y') goto yy1530; if (yych != 'y') goto yy154; - YYDEBUG(1539, *YYCURSOR); yyaccept = 33; yych = *(YYMARKER = ++YYCURSOR); if (yybm[0+yych] & 16) { @@ -24803,6 +23240,11 @@ timelib_time* timelib_strtotime(char *s, size_t len, struct timelib_error_contai { \ add_pbf_error(s, "Unexpected data found.", string, begin); \ } +#define TIMELIB_CHECK_SIGNED_NUMBER \ + if (strchr("-0123456789", *ptr) == NULL) \ + { \ + add_pbf_error(s, "Unexpected data found.", string, begin); \ + } static void timelib_time_reset_fields(timelib_time *time) { @@ -25007,7 +23449,7 @@ timelib_time *timelib_parse_from_format(char *format, char *string, size_t len, timelib_eat_spaces((char **) &ptr); break; case 'U': /* epoch seconds */ - TIMELIB_CHECK_NUMBER; + TIMELIB_CHECK_SIGNED_NUMBER; TIMELIB_HAVE_RELATIVE(); tmp = timelib_get_unsigned_nr((char **) &ptr, 24); s->time->y = 1970; diff --git a/ext/date/tests/bug66836.phpt b/ext/date/tests/bug66836.phpt new file mode 100644 index 0000000000000..8fab7837ea8e5 --- /dev/null +++ b/ext/date/tests/bug66836.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #66836 (DateTime::createFromFormat 'U' with pre 1970 dates fails parsing) +--INI-- +date.timezone=Europe/Berlin +--FILE-- +format('U') === $timestamp); +} +?> +--EXPECT-- +bool(true) +bool(true) +bool(true) diff --git a/ext/dba/libinifile/inifile.c b/ext/dba/libinifile/inifile.c index 0feb5f1bb2ded..95ac9a8ea61cf 100644 --- a/ext/dba/libinifile/inifile.c +++ b/ext/dba/libinifile/inifile.c @@ -250,6 +250,7 @@ val_type inifile_fetch(inifile *dba, const key_type *key, int skip TSRMLS_DC) { if (skip == -1 && dba->next.key.group && dba->next.key.name && !inifile_key_cmp(&dba->next.key, key TSRMLS_CC)) { /* we got position already from last fetch */ php_stream_seek(dba->fp, dba->next.pos, SEEK_SET); + ln.key.group = estrdup(dba->next.key.group); } else { /* specific instance or not same key -> restart search */ /* the slow way: restart and seacrch */ @@ -402,7 +403,7 @@ static int inifile_copy_to(inifile *dba, size_t pos_start, size_t pos_end, inifi return FAILURE; } php_stream_seek(dba->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp, pos_end - pos_start, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy group [%zu - %zu] to temporary stream", pos_start, pos_end); return FAILURE; } @@ -427,7 +428,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML pos_curr = php_stream_tell(from->fp); if (pos_start != pos_next) { php_stream_seek(from->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); ret = FAILURE; } @@ -446,7 +447,7 @@ static int inifile_filter(inifile *dba, inifile *from, const key_type *key TSRML } if (pos_start != pos_next) { php_stream_seek(from->fp, pos_start, SEEK_SET); - if (!php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(from->fp, dba->fp, pos_next - pos_start, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy [%zu - %zu] from temporary stream", pos_next, pos_start); ret = FAILURE; } @@ -497,7 +498,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons php_stream_seek(dba->fp, 0, SEEK_END); if (pos_grp_next != (size_t)php_stream_tell(dba->fp)) { php_stream_seek(dba->fp, pos_grp_next, SEEK_SET); - if (!php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(dba->fp, fp_tmp, PHP_STREAM_COPY_ALL, NULL)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not copy remainder to temporary stream"); ret = FAILURE; } @@ -538,7 +539,7 @@ static int inifile_delete_replace_append(inifile *dba, const key_type *key, cons if (fp_tmp && php_stream_tell(fp_tmp)) { php_stream_seek(fp_tmp, 0, SEEK_SET); php_stream_seek(dba->fp, 0, SEEK_END); - if (!php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) { + if (SUCCESS != php_stream_copy_to_stream_ex(fp_tmp, dba->fp, PHP_STREAM_COPY_ALL, NULL)) { php_error_docref(NULL TSRMLS_CC, E_RECOVERABLE_ERROR, "Could not copy from temporary stream - ini file truncated"); ret = FAILURE; } diff --git a/ext/dba/tests/bug70825.phpt b/ext/dba/tests/bug70825.phpt new file mode 100644 index 0000000000000..ff05f01cf4f6c --- /dev/null +++ b/ext/dba/tests/bug70825.phpt @@ -0,0 +1,71 @@ +--TEST-- +Bug #70825 (Cannot fetch multiple values with group in ini file) +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECT-- +string(2) "23" +string(2) "42" +string(4) "1337" +string(2) "23" +string(2) "42" +string(4) "1337" +string(2) "23" +string(2) "42" +string(4) "1337" +string(2) "23" +string(2) "42" +string(4) "1337" +==DONE== +--CLEAN-- + diff --git a/ext/dba/tests/bug71514.phpt b/ext/dba/tests/bug71514.phpt new file mode 100644 index 0000000000000..08338f3793c1a --- /dev/null +++ b/ext/dba/tests/bug71514.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #71514 (Bad dba_replace condition because of wrong API usage) +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECT-- +string(6) "value2" +==DONE== +--CLEAN-- + diff --git a/ext/dba/tests/dba_handler.inc b/ext/dba/tests/dba_handler.inc index a950e903af426..0f348bc01e411 100644 --- a/ext/dba/tests/dba_handler.inc +++ b/ext/dba/tests/dba_handler.inc @@ -40,7 +40,7 @@ do { } if ($handler != 'cdb') { $db_writer = dba_open($db_filename, 'c'.$lock_flag, $handler); - if (($dba_reader = @dba_open($db_filename, 'r'.$lock_flag.($lock_flag ? 't' : ''), $handler))===false) { + if (($dba_reader = @dba_open($db_filename, 'r'.$lock_flag.'t', $handler))===false) { echo "Read during write: not allowed\n"; } else { echo "Read during write: allowed\n"; diff --git a/ext/dom/tests/bug66502.phpt b/ext/dom/tests/bug66502.phpt new file mode 100644 index 0000000000000..5b35b41e939da --- /dev/null +++ b/ext/dom/tests/bug66502.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #66502 (DOM document dangling reference) +--SKIPIF-- + +--FILE-- +appendChild(new DOMElement('root')); +$comment = new DOMComment("Comment 0"); +$comment = $element->appendChild($comment); + +$comment->__construct("Comment 1"); +$comment->__construct("Comment 2"); +$comment->__construct("Comment 3"); +echo 'DONE', PHP_EOL; +?> +--EXPECT-- +DONE \ No newline at end of file diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c index 5d38d04375027..8eb833ac873b2 100644 --- a/ext/ereg/ereg.c +++ b/ext/ereg/ereg.c @@ -743,6 +743,11 @@ PHP_EREG_API PHP_FUNCTION(sql_regcase) for (i = j = 0; i < string_len; i++) { c = (unsigned char) string[i]; + if ( j >= INT_MAX - 1 || (isalpha(c) && j >= INT_MAX - 4)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "String too long, max length is %d", INT_MAX); + efree(tmp); + RETURN_FALSE; + } if (isalpha(c)) { tmp[j++] = '['; tmp[j++] = toupper(c); diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 1ff4b4b14effa..657a2cc1f26ea 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -1709,6 +1709,10 @@ static void exif_iif_add_value(image_info_type *image_info, int section_index, c break; case TAG_FMT_UNDEFINED: if (value) { + if (tag == TAG_MAKER_NOTE) { + length = MIN(length, strlen(value)); + } + /* do not recompute length here */ info_value->s = estrndup(value, length); info_data->length = length; @@ -2613,6 +2617,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP *pszEncoding = NULL; /* Copy the comment */ if (ByteCount>=8) { + const zend_encoding *from, *to; if (!memcmp(szValuePtr, "UNICODE\0", 8)) { *pszEncoding = estrdup((const char*)szValuePtr); szValuePtr = szValuePtr+8; @@ -2633,14 +2638,16 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP } else { decode = ImageInfo->decode_unicode_le; } + to = zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC); + from = zend_multibyte_fetch_encoding(decode TSRMLS_CC); /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */ - if (zend_multibyte_encoding_converter( + if (!to || !from || zend_multibyte_encoding_converter( (unsigned char**)pszInfoPtr, &len, (unsigned char*)szValuePtr, ByteCount, - zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC), - zend_multibyte_fetch_encoding(decode TSRMLS_CC) + to, + from TSRMLS_CC) == (size_t)-1) { len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount); } @@ -2655,13 +2662,15 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP szValuePtr = szValuePtr+8; ByteCount -= 8; /* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */ - if (zend_multibyte_encoding_converter( + to = zend_multibyte_fetch_encoding(ImageInfo->encode_jis TSRMLS_CC); + from = zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le TSRMLS_CC); + if (!to || !from || zend_multibyte_encoding_converter( (unsigned char**)pszInfoPtr, &len, (unsigned char*)szValuePtr, ByteCount, - zend_multibyte_fetch_encoding(ImageInfo->encode_jis TSRMLS_CC), - zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le TSRMLS_CC) + to, + from TSRMLS_CC) == (size_t)-1) { len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount); } @@ -2718,8 +2727,14 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu char *dir_start; for (i=0; i<=sizeof(maker_note_array)/sizeof(maker_note_type); i++) { - if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) - return FALSE; + if (i==sizeof(maker_note_array)/sizeof(maker_note_type)) { +#ifdef EXIF_DEBUG + exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "No maker note data found. Detected maker: %s (length = %d)", ImageInfo->make, strlen(ImageInfo->make)); +#endif + /* unknown manufacturer, not an error, use it as a string */ + return TRUE; + } + maker_note = maker_note_array+i; /*exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "check (%s,%s)", maker_note->make?maker_note->make:"", maker_note->model?maker_note->model:"");*/ @@ -2732,6 +2747,12 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu break; } + if (maker_note->offset >= value_len) { + /* Do not go past the value end */ + exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data too short: 0x%04X offset 0x%04X", value_len, maker_note->offset); + return FALSE; + } + dir_start = value_ptr + maker_note->offset; #ifdef EXIF_DEBUG @@ -2760,10 +2781,19 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu offset_base = value_ptr; break; case MN_OFFSET_GUESS: + if (maker_note->offset + 10 + 4 >= value_len) { + /* Can not read dir_start+10 since it's beyond value end */ + exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data too short: 0x%04X", value_len); + return FALSE; + } offset_diff = 2 + NumDirEntries*12 + 4 - php_ifd_get32u(dir_start+10, ImageInfo->motorola_intel); #ifdef EXIF_DEBUG exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Using automatic offset correction: 0x%04X", ((int)dir_start-(int)offset_base+maker_note->offset+displacement) + offset_diff); #endif + if (offset_diff < 0 || offset_diff >= value_len ) { + exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "IFD data bad offset: 0x%04X length 0x%04X", offset_diff, value_len); + return FALSE; + } offset_base = value_ptr + offset_diff; break; default: @@ -2772,7 +2802,7 @@ static int exif_process_IFD_in_MAKERNOTE(image_info_type *ImageInfo, char * valu } if ((2+NumDirEntries*12) > value_len) { - exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 2 + x%04X*12 = x%04X > x%04X", NumDirEntries, 2+NumDirEntries*12, value_len); + exif_error_docref("exif_read_data#error_ifd" EXIFERR_CC, ImageInfo, E_WARNING, "Illegal IFD size: 2 + 0x%04X*12 = 0x%04X > 0x%04X", NumDirEntries, 2+NumDirEntries*12, value_len); return FALSE; } @@ -3058,7 +3088,10 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha break; case TAG_MAKER_NOTE: - exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement TSRMLS_CC); + if (!exif_process_IFD_in_MAKERNOTE(ImageInfo, value_ptr, byte_count, offset_base, IFDlength, displacement TSRMLS_CC)) { + EFREE_IF(outside); + return FALSE; + } break; case TAG_EXIF_IFD_POINTER: @@ -3735,8 +3768,11 @@ static int exif_process_IFD_in_TIFF(image_info_type *ImageInfo, size_t dir_offse fgot = php_stream_read(ImageInfo->infile, ImageInfo->Thumbnail.data, ImageInfo->Thumbnail.size); if (fgot < ImageInfo->Thumbnail.size) { EXIF_ERRLOG_THUMBEOF(ImageInfo) + efree(ImageInfo->Thumbnail.data); + ImageInfo->Thumbnail.data = NULL; + } else { + exif_thumbnail_build(ImageInfo TSRMLS_CC); } - exif_thumbnail_build(ImageInfo TSRMLS_CC); } #ifdef EXIF_DEBUG exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_NOTICE, "Read next IFD (THUMBNAIL) done"); diff --git a/ext/exif/tests/bug54002.phpt b/ext/exif/tests/bug54002.phpt index c51fa58897bb5..8f85339190ace 100644 --- a/ext/exif/tests/bug54002.phpt +++ b/ext/exif/tests/bug54002.phpt @@ -13,8 +13,4 @@ exif_read_data(__DIR__ . '/bug54002_2.jpeg'); --EXPECTF-- Warning: exif_read_data(bug54002_1.jpeg): Process tag(x0205=UndefinedTa): Illegal byte_count in %sbug54002.php on line %d -Warning: exif_read_data(bug54002_1.jpeg): Process tag(xA000=FlashPixVer): Illegal pointer offset(%s) in %sbug54002.php on line %d - -Warning: exif_read_data(bug54002_2.jpeg): Process tag(x0205=UndefinedTa): Illegal byte_count in %sbug54002.php on line %d - -Warning: exif_read_data(bug54002_2.jpeg): Process tag(xA000=FlashPixVer): Illegal pointer offset(%s) in %sbug54002.php on line %d +Warning: exif_read_data(bug54002_2.jpeg): Process tag(x0205=UndefinedTa): Illegal byte_count in %sbug54002.php on line %d \ No newline at end of file diff --git a/ext/exif/tests/bug62523_2.phpt b/ext/exif/tests/bug62523_2.phpt index ddc8ae824e82e..689ed0679dffd 100644 --- a/ext/exif/tests/bug62523_2.phpt +++ b/ext/exif/tests/bug62523_2.phpt @@ -10,7 +10,9 @@ echo "Test\n"; var_dump(count(exif_read_data(__DIR__."/bug62523_2.jpg"))); ?> Done ---EXPECT-- +--EXPECTF-- Test -int(76) + +Warning: exif_read_data(bug62523_2.jpg): IFD data bad offset: 0xADB23672 length 0x0D94 in %s%ebug62523_2.php on line %d +int(30) Done diff --git a/ext/exif/tests/bug72603.jpeg b/ext/exif/tests/bug72603.jpeg new file mode 100644 index 0000000000000..1764c805fbca3 Binary files /dev/null and b/ext/exif/tests/bug72603.jpeg differ diff --git a/ext/exif/tests/bug72603.phpt b/ext/exif/tests/bug72603.phpt new file mode 100644 index 0000000000000..71d3943446162 --- /dev/null +++ b/ext/exif/tests/bug72603.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #72603 (Out of bound read in exif_process_IFD_in_MAKERNOTE) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: exif_read_data(bug72603.jpeg): %s in %s%ebug72603.php on line %d +int(%d) diff --git a/ext/exif/tests/bug72618.jpg b/ext/exif/tests/bug72618.jpg new file mode 100644 index 0000000000000..0a61ae2e020ae Binary files /dev/null and b/ext/exif/tests/bug72618.jpg differ diff --git a/ext/exif/tests/bug72618.phpt b/ext/exif/tests/bug72618.phpt new file mode 100644 index 0000000000000..c4fe8e3f90753 --- /dev/null +++ b/ext/exif/tests/bug72618.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug 72618 (NULL Pointer Dereference in exif_process_user_comment) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: exif_read_data(bug72618.jpg): %s in %s%ebug72618.php on line %d +int(%d) diff --git a/ext/exif/tests/bug72627.phpt b/ext/exif/tests/bug72627.phpt new file mode 100644 index 0000000000000..bb6a1fae99a18 --- /dev/null +++ b/ext/exif/tests/bug72627.phpt @@ -0,0 +1,71 @@ +--TEST-- +Bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: exif_read_data(%s): Thumbnail goes IFD boundary or end of file reached in %sbug72627.php on line %d + +Warning: exif_read_data(%s): Error in TIFF: filesize(x04E2) less than start of IFD dir(x829A0004) in %sbug72627.php on line %d + +Warning: exif_read_data(%s): Thumbnail goes IFD boundary or end of file reached in %sbug72627.php on line %d +array(11) { + ["FileName"]=> + string(13) "bug72627.tiff" + ["FileDateTime"]=> + int(%d) + ["FileSize"]=> + int(1250) + ["FileType"]=> + int(7) + ["MimeType"]=> + string(10) "image/tiff" + ["SectionsFound"]=> + string(30) "ANY_TAG, IFD0, THUMBNAIL, EXIF" + ["COMPUTED"]=> + array(10) { + ["html"]=> + string(24) "width="128" height="132"" + ["Height"]=> + int(132) + ["Width"]=> + int(128) + ["IsColor"]=> + int(0) + ["ByteOrderMotorola"]=> + int(0) + ["ApertureFNumber"]=> + string(5) "f/1.0" + ["Thumbnail.FileType"]=> + int(2) + ["Thumbnail.MimeType"]=> + string(10) "image/jpeg" + ["Thumbnail.Height"]=> + int(132) + ["Thumbnail.Width"]=> + int(128) + } + ["XResolution"]=> + string(21) "1414812756/1414812756" + ["THUMBNAIL"]=> + array(5) { + ["ImageWidth"]=> + int(128) + ["ImageLength"]=> + int(132) + ["JPEGInterchangeFormat"]=> + int(1280) + ["JPEGInterchangeFormatLength"]=> + int(100) + ["THUMBNAIL"]=> + NULL + } + ["ExposureTime"]=> + string(21) "1414812756/1414812756" + ["FNumber"]=> + string(21) "1414812756/1414812756" +} diff --git a/ext/exif/tests/bug72627.tiff b/ext/exif/tests/bug72627.tiff new file mode 100644 index 0000000000000..229190a604192 Binary files /dev/null and b/ext/exif/tests/bug72627.tiff differ diff --git a/ext/fileinfo/tests/bug69107.phpt b/ext/fileinfo/tests/bug69107.phpt new file mode 100644 index 0000000000000..9a7b26b5d1936 --- /dev/null +++ b/ext/fileinfo/tests/bug69107.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #69107 (finfo no longer detects PHP files) +--SKIPIF-- + +--FILE-- +buffer("buffer("buffer("buffer(" +===DONE=== +--EXPECT-- +string(10) "text/x-php" +string(10) "text/x-php" +string(10) "text/x-php" +string(10) "text/x-php" +===DONE=== diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index 0e55c2548bec9..521fb50a3a6cd 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -704,6 +704,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ if (flags & FILTER_FLAG_NO_PRIV_RANGE) { if ( (ip[0] == 10) || + (ip[0] == 169 && ip[1] == 254) || (ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) || (ip[0] == 192 && ip[1] == 168) ) { @@ -714,10 +715,18 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */ if (flags & FILTER_FLAG_NO_RES_RANGE) { if ( (ip[0] == 0) || + (ip[0] == 10) || (ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) || + (ip[0] == 127) || (ip[0] == 169 && ip[1] == 254) || + (ip[0] == 172 && (ip[1] >= 16 && ip[1] <= 31)) || + (ip[0] == 192 && ip[1] == 0 && ip[2] == 0) || (ip[0] == 192 && ip[1] == 0 && ip[2] == 2) || - (ip[0] == 127 && ip[1] == 0 && ip[2] == 0 && ip[3] == 1) || + (ip[0] == 192 && ip[1] == 88 && ip[2] == 99) || + (ip[0] == 192 && ip[1] == 168) || + (ip[0] == 198 && (ip[1] == 18 || ip[1] == 19)) || + (ip[0] == 198 && ip[1] == 51 && ip[2] == 100) || + (ip[0] == 203 && ip[1] == 0 && ip[2] == 113) || (ip[0] >= 224 && ip[0] <= 255) ) { RETURN_VALIDATION_FAILED diff --git a/ext/filter/tests/018.phpt b/ext/filter/tests/018.phpt index 75bbd13427994..11d7fc64efef6 100644 --- a/ext/filter/tests/018.phpt +++ b/ext/filter/tests/018.phpt @@ -41,7 +41,7 @@ string(9) "127.0.0.1" bool(false) string(12) "192.0.34.166" bool(false) -string(9) "192.0.0.1" +bool(false) bool(false) bool(false) string(12) "192.0.34.166" diff --git a/ext/filter/tests/filter_ipv4_rfc6890.phpt b/ext/filter/tests/filter_ipv4_rfc6890.phpt new file mode 100644 index 0000000000000..cfd9f8dc0773a --- /dev/null +++ b/ext/filter/tests/filter_ipv4_rfc6890.phpt @@ -0,0 +1,137 @@ +--TEST-- +Bug #71745 FILTER_FLAG_NO_RES_RANGE does not cover whole 127.0.0.0/8 range +--FILE-- + $range) { + list($min, $max) = $range; + var_dump($key); + var_dump(filter_var($min, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE)); + var_dump(filter_var($max, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE)); +} + +$reservedRanges = array(); + +// 0.0.0.0/8 +$reserverRanges['0.0.0.0/8'] = array('0.0.0.0', '0.255.255.255'); + +// 10.0.0.0/8 +$reserverdRanges['10.0.0.0/8'] = array('10.0.0.0', '10.255.255.255'); + +// 100.64.0.0/10 +$reserverdRanges['10.64.0.0/10'] = array('100.64.0.0', '100.127.255.255'); + +// 127.0.0.0/8 +$reserverdRanges['127.0.0.0/8'] = array('127.0.0.0', '127.255.255.255'); + +// 169.254.0.0/16 +$reserverdRanges['169.254.0.0/16'] = array('169.254.0.0', '169.254.255.255'); + +// 172.16.0.0/12 +$reserverdRanges['172.16.0.0/12'] = array('172.16.0.0', '172.31.0.0'); + +// 192.0.0.0/24 +$reserverdRanges['192.0.0.0/24'] = array('192.0.0.0', '192.0.0.255'); + +// 192.0.0.0/29 +$reserverdRanges['192.0.0.0/29'] = array('192.0.0.0', '192.0.0.7'); + +// 192.0.2.0/24 +$reserverdRanges['192.0.2.0/24'] = array('192.0.2.0', '192.0.2.255'); + +// 198.18.0.0/15 +$reserverdRanges['198.18.0.0/15'] = array('198.18.0.0', '198.19.255.255'); + +// 198.51.100.0/24 +$reserverdRanges['198.51.100.0/24'] = array('198.51.100.0', '198.51.100.255'); + +// 192.88.99.0/24 +$reserverdRanges['192.88.99.0/24'] = array('192.88.99.0', '192.88.99.255'); + +// 192.168.0.0/16 +$reserverdRanges['192.168.0.0/16'] = array('192.168.0.0', '192.168.255.255'); + +// 203.0.113.0/24 +$reserverdRanges['203.0.113.0/24'] = array('203.0.113.0', '203.0.113.255'); + +// 240.0.0.0/4 + 255.255.255.255/32 +$reserverdRanges['240.0.0.0/4'] = array('224.0.0.0', '255.255.255.255'); + +foreach ($reserverdRanges as $key => $range) { + list($min, $max) = $range; + var_dump($key); + var_dump(filter_var($min, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_RES_RANGE)); + var_dump(filter_var($max, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_RES_RANGE)); +} + + + +--EXPECT-- +string(10) "10.0.0.0/8" +bool(false) +bool(false) +string(14) "168.254.0.0/16" +bool(false) +bool(false) +string(13) "172.16.0.0/12" +bool(false) +bool(false) +string(14) "192.168.0.0/16" +bool(false) +bool(false) +string(10) "10.0.0.0/8" +bool(false) +bool(false) +string(12) "10.64.0.0/10" +bool(false) +bool(false) +string(11) "127.0.0.0/8" +bool(false) +bool(false) +string(14) "169.254.0.0/16" +bool(false) +bool(false) +string(13) "172.16.0.0/12" +bool(false) +bool(false) +string(12) "192.0.0.0/24" +bool(false) +bool(false) +string(12) "192.0.0.0/29" +bool(false) +bool(false) +string(12) "192.0.2.0/24" +bool(false) +bool(false) +string(13) "198.18.0.0/15" +bool(false) +bool(false) +string(15) "198.51.100.0/24" +bool(false) +bool(false) +string(14) "192.88.99.0/24" +bool(false) +bool(false) +string(14) "192.168.0.0/16" +bool(false) +bool(false) +string(14) "203.0.113.0/24" +bool(false) +bool(false) +string(11) "240.0.0.0/4" +bool(false) +bool(false) diff --git a/ext/ftp/ftp.c b/ext/ftp/ftp.c index f0bfb9459c925..d2f726d038f09 100644 --- a/ext/ftp/ftp.c +++ b/ext/ftp/ftp.c @@ -290,6 +290,9 @@ ftp_login(ftpbuf_t *ftp, const char *user, const char *pass TSRMLS_DC) #endif SSL_CTX_set_options(ctx, ssl_ctx_options); + /* allow SSL to re-use sessions */ + SSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_BOTH); + ftp->ssl_handle = SSL_new(ctx); if (ftp->ssl_handle == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create the SSL handle"); @@ -1495,7 +1498,8 @@ data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC) #if HAVE_OPENSSL_EXT SSL_CTX *ctx; - long ssl_ctx_options = SSL_OP_ALL; + SSL_SESSION *session; + int result; #endif if (data->fd != -1) { @@ -1516,31 +1520,40 @@ data_accept(databuf_t *data, ftpbuf_t *ftp TSRMLS_DC) /* now enable ssl if we need to */ if (ftp->use_ssl && ftp->use_ssl_for_data) { - ctx = SSL_CTX_new(SSLv23_client_method()); + ctx = SSL_get_SSL_CTX(ftp->ssl_handle); if (ctx == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL context"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to retreive the existing SSL context"); return 0; } -#if OPENSSL_VERSION_NUMBER >= 0x0090605fL - ssl_ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; -#endif - SSL_CTX_set_options(ctx, ssl_ctx_options); - data->ssl_handle = SSL_new(ctx); if (data->ssl_handle == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to create the SSL handle"); - SSL_CTX_free(ctx); return 0; } - SSL_set_fd(data->ssl_handle, data->fd); if (ftp->old_ssl) { SSL_copy_session_id(data->ssl_handle, ftp->ssl_handle); } + /* get the session from the control connection so we can re-use it */ + session = SSL_get_session(ftp->ssl_handle); + if (session == NULL) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to retreive the existing SSL session"); + SSL_free(data->ssl_handle); + return 0; + } + + /* and set it on the data connection */ + result = SSL_set_session(data->ssl_handle, session); + if (result == 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: failed to set the existing SSL session"); + SSL_free(data->ssl_handle); + return 0; + } + if (SSL_connect(data->ssl_handle) <= 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_accept: SSL/TLS handshake failed"); SSL_shutdown(data->ssl_handle); @@ -1571,10 +1584,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data) if (data->listener != -1) { #if HAVE_OPENSSL_EXT if (data->ssl_active) { - - ctx = SSL_get_SSL_CTX(data->ssl_handle); - SSL_CTX_free(ctx); - + /* don't free the data context, it's the same as the control */ SSL_shutdown(data->ssl_handle); SSL_free(data->ssl_handle); data->ssl_active = 0; @@ -1585,9 +1595,7 @@ data_close(ftpbuf_t *ftp, databuf_t *data) if (data->fd != -1) { #if HAVE_OPENSSL_EXT if (data->ssl_active) { - ctx = SSL_get_SSL_CTX(data->ssl_handle); - SSL_CTX_free(ctx); - + /* don't free the data context, it's the same as the control */ SSL_shutdown(data->ssl_handle); SSL_free(data->ssl_handle); data->ssl_active = 0; diff --git a/ext/ftp/tests/cert.pem b/ext/ftp/tests/cert.pem index 94c61ffcc31fe..2bb30614ed60e 100644 --- a/ext/ftp/tests/cert.pem +++ b/ext/ftp/tests/cert.pem @@ -1,48 +1,49 @@ ------BEGIN CERTIFICATE REQUEST----- -MIIBmzCCAQQCAQAwWzELMAkGA1UEBhMCUFQxCzAJBgNVBAgTAkx4MQswCQYDVQQH -EwJMeDEcMBoGA1UEChMTQSBtaW5oYSBlbXByZXNhLCBTQTEUMBIGA1UECxMLUEhQ -IFFBIFRlYW0wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM9mfEOSYwXf58ch -4NyO1QOU1XMfquz8OVpvMUITABLAevZpeQn6vZPHNyXHFQC0QC8scydK1rAYd2U+ -9K2aPub6ioMjYyjPpAE07l9EAAPUEBlqqsziB/wT8QjWkByyJEkYu+o0Wyjokhfn -BMPvm52wLWUx9nvUeNDCftnKg1wxAgMBAAGgADANBgkqhkiG9w0BAQQFAAOBgQDD -s1FeqPxnF2bWj8/dG8MyPaRfOAMVz1UsCZUciXIVG5LSIvR2qnMC3iEYt3s13sEq -z8VJlNHa8nniE+VFNv093yIu+PlWXMEvb5y5EFqP2AYq3RAT+SJsSxGqIdzPZiKY -INaktLCZmQ/E1v7/4hFzVRq9ydJI82DVS1nv282Whw== ------END CERTIFICATE REQUEST----- -----BEGIN CERTIFICATE----- -MIIC4zCCAkygAwIBAgIBADANBgkqhkiG9w0BAQQFADBbMQswCQYDVQQGEwJQVDEL -MAkGA1UECBMCTHgxCzAJBgNVBAcTAkx4MRwwGgYDVQQKExNBIG1pbmhhIGVtcHJl -c2EsIFNBMRQwEgYDVQQLEwtQSFAgUUEgVGVhbTAeFw0wNjExMTkxODIzNTNaFw0w -NzExMTkxODIzNTNaMFsxCzAJBgNVBAYTAlBUMQswCQYDVQQIEwJMeDELMAkGA1UE -BxMCTHgxHDAaBgNVBAoTE0EgbWluaGEgZW1wcmVzYSwgU0ExFDASBgNVBAsTC1BI -UCBRQSBUZWFtMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPZnxDkmMF3+fH -IeDcjtUDlNVzH6rs/DlabzFCEwASwHr2aXkJ+r2TxzclxxUAtEAvLHMnStawGHdl -PvStmj7m+oqDI2Moz6QBNO5fRAAD1BAZaqrM4gf8E/EI1pAcsiRJGLvqNFso6JIX -5wTD75udsC1lMfZ71HjQwn7ZyoNcMQIDAQABo4G2MIGzMB0GA1UdDgQWBBTIga5L -q+Ub1SWXgNZRYCpq3c8Z+jCBgwYDVR0jBHwweoAUyIGuS6vlG9Ull4DWUWAqat3P -GfqhX6RdMFsxCzAJBgNVBAYTAlBUMQswCQYDVQQIEwJMeDELMAkGA1UEBxMCTHgx -HDAaBgNVBAoTE0EgbWluaGEgZW1wcmVzYSwgU0ExFDASBgNVBAsTC1BIUCBRQSBU -ZWFtggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAe6AA8aC3KDI8 -smd+7XWjaTSp1Q0uMkEZ2PEBzif2I1aPPqw1CQykJ1iDdC/8PJ1yEIezloP2XQoZ -NjTaCO+uubay03ncoPTZvDUwExN9BYFAYgc2z3tLMHYbA7kM2sIbKys7ZQegLibr -TSKYQOBeYA/FB9GHECJGU3zBRvYi+Og= +MIIDhTCCAm2gAwIBAgIJAN75FFz+owOAMA0GCSqGSIb3DQEBCwUAMFkxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQxEjAQBgNVBAMMCTEyNy4wLjAuMTAeFw0xNjA3MjUxMjM3 +MTJaFw0yNjA3MjMxMjM3MTJaMFkxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21l +LVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQxEjAQBgNV +BAMMCTEyNy4wLjAuMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALtG +AIrNUDItISfpAqztL2TFEWEHLGTzCEh5Ag2sdMD7UYbqIPHLOE4EINv+dqEMM0Nz +LYnw7ChtVegXT907xCaQcmeDFSdhqze4L8zawDfnn4syB8XAwGYJfpstYwe3nO6+ +0WvLSb1A5TYNeyoXjwlAUKElxkeWAo51uhR41GDhDQ9GgpqX1ccAhmSoUhgIRSzf +6f4KE3WTdzl1p12ZtkYHB8Jo2jB/JXnwGOz6isLnpRvkex4B7sUX+7u1MqK/e1X7 +Hi1G/VkaAfC2SOfjTePtGBDBXrQ1arYXDPRA04sgFzSh55l7lC/4HasQ/jAb3h95 +dcEIqyc69iioaN1c1NcCAwEAAaNQME4wHQYDVR0OBBYEFNv3kefb1H+6/6CpjiBi ++I2s9E90MB8GA1UdIwQYMBaAFNv3kefb1H+6/6CpjiBi+I2s9E90MAwGA1UdEwQF +MAMBAf8wDQYJKoZIhvcNAQELBQADggEBAIzSEWpHSaBs7KduBRXX5+qFxBN6OCPl +7ID0rxAOYfw7ruzbmwgOpBgMIHGn+KqA6CmQI0jh9bZbv5TV2aFpFsUihugPc2lW +5EshCozxlEPmIJNsO8jDqPE4w3m4KiVTscRWjBa5cco+lwLDqboerm2l7vvrtr6B +pgLaZct1c73MouvoJSCGK5EOGW7jsgaxjxJ3UZug+24Ko1wulO2cgBLhda9Ilrnx +CIKI9h8Z2WVWuVQfyCyO1g7XkJgkBec77OhxD+m4onzPY6waqnnhmFOBcS+gKgBV +jHeK9DCvZ9zet3EyEp6fyQOOtsC+gU0piYgfsQL7aCp5oLe+fjTiuUY= -----END CERTIFICATE----- ------BEGIN RSA PRIVATE KEY----- -Proc-Type: 4,ENCRYPTED -DEK-Info: DES-EDE3-CBC,928762DB6DE222AD - -oOxNUBX0wrqmRqb3IEZMogc1bnVm6JoW6YFjGfHNcIz0jS7UPDhUFDR26y0dYujL -LEgxOcYo8ItvGcXSRbs+3W7lISbosgkB0DOaKx5jVmOGwUVRergUUSY8rbf93FtP -27CEvAfsU6do5HmlJ34mYZW1k+onCznlJXJkupQ5jmiily3GwEdr/5mMIVOmXQ6p -xWkxHySDKyVbR0v4JY3SJLRBuhgofYNG5155PiqZ7KwYY4Aw60eVgINsvJCF9/8b -kEj+lecHbBdAf7N82320Ga+F+VeFnUl0gWFjoIF9UFCO80+7ZvIGdGlyPkr4zMvt -TsC1snJQdHg+IlT3sGayYrQANpTG6GPYhn3KEvK5aqq+bPEe5lija0gw34jbPCo+ -TjHR76lToxzubGZODyyF/rjl5KwUbqTCNuv1PX1jTx7n7sCbu+KHpqXMhTHLKtby -+Wh7WAfsVrbIW+P85/mkfhPbPZ2621f9cyStdFGgWU4dHdD00HIGOgAJvUSbC2Au -oVUoKf2818t1s9aA4ptog04sNi+Ixu+z+3yYNLZj51j4ZX3KuXxLIiQvlvFQ8LQi -RHGQk3u2W3iNtDKKUQjMPaB2FlVtC7FmtHBCpRmos6ld240DDyucqMdIDTMaqV0+ -sL4X+LIeBM/hP/IquRTuQBHBmgjkN4845ihTUJOanyKx605ANq/roHzXrbIxhR5p -pcJLCBMLMWgdOCJMZRavSq04iXeNfP6Mk/joVpHS62Ljdfc94BBLfsOKOErA20Nq -lfvbZqy2tI5IIDoq05S8FU0DYNqq/hyrv9Udo8IAo+WkBOABm0x/WA== ------END RSA PRIVATE KEY----- - \ No newline at end of file +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC7RgCKzVAyLSEn +6QKs7S9kxRFhByxk8whIeQINrHTA+1GG6iDxyzhOBCDb/nahDDNDcy2J8OwobVXo +F0/dO8QmkHJngxUnYas3uC/M2sA355+LMgfFwMBmCX6bLWMHt5zuvtFry0m9QOU2 +DXsqF48JQFChJcZHlgKOdboUeNRg4Q0PRoKal9XHAIZkqFIYCEUs3+n+ChN1k3c5 +daddmbZGBwfCaNowfyV58Bjs+orC56Ub5HseAe7FF/u7tTKiv3tV+x4tRv1ZGgHw +tkjn403j7RgQwV60NWq2Fwz0QNOLIBc0oeeZe5Qv+B2rEP4wG94feXXBCKsnOvYo +qGjdXNTXAgMBAAECggEAD7yDISa9fWnjZlojGmrX16zjl/alWVo+sPBSJtn9+ZVk +tWSJHihIc+3O4Q2R5FiFGj7cbcHr5j3BwT3sPRfflKoAowgVx/hiDc2RXrJnAouZ +EXZDxu86e5iCpgF7V9OrATjRmjA74wZH/HHHjrLqFwnrfI8TCULmthfYag35Mqax +qrIEzvSuYdaGxblNe+ZfnVEDW2F9DLBGcma0ffUlJp8AvV7bpo8Rj/JovPxit/VS +UdwSRxwSAugctFpmcGlFkoQfxUx1WdEy8hjopLrayMjCCJvRUL4+C4zT9r9PBHOj +fCSbJ+ajQIoRrgaL9bURk8BFMHY8+yMUsWEYVSmFAQKBgQDtOvPkhvZsNocUB5nJ +ti3SXyDQ6OZQuKKHPSeDV/EvmZKeNlrQ1ZnwXLP3vkcedDOkt1nEVq/hUewpjt08 +2MvmMwJBQEnmbTzMf43DtlXsStdP1lhYaFbU4iMM5zRfyBHDu1GPZEPXvKKpJUk0 +M+jYIyTAP3mcZhqDKn0mPVP7VwKBgQDKFy9DtWFKxCvhFQvHx7YeZiVWJbIst/O4 +ZyuPVAErni0hzSeCkmm7+F9hgEdPSLRcSaeTWP4L0u1cixECKboIhoNs38aft7o3 +MdnI2RDSEKtKX2uVuhvpGDNuGpBAc8Qu8iCiv5INSC36ZhD1h++O/TiiUdgRJ3yX +yeG7ej+CgQKBgCR5F95e0aw5hfMSaBaXJ9xcO9Niu2ZVvMdGI7kR4EcNOXmRqczJ +ym0mE5VXb9/Cxd3hQq/pFAl0avbIvEMKoe62kPYvSC1hRiO6yLT6Z6N4rjncHqEZ +CaCZVAI72dWQEQsi1ZtSMwwMOIYA8YxRHs98N75HBA+DszfPZIZoj2zpAoGBAJHp +B3ElhmeLF/tdTLIj2bQ9H/wBH5H2Bvw/UU4c4vNxMzjSfRJjUAAtpgAptFLkNYTk +kR9sA5DZ7BMDPXaIVg9Nv5peP3SWHNc5IPtI7kIdUu9R0cW7J+e2V3vJphlC/ITA +wRuAoZ0BXmEKTHhae3aMEdXwrcZE8kpNsrO/4hcBAoGBAMISiPJPuxAX1UtqcxTa +mDJfnQ2gxRu6AK9VmXqo0X4IBxDSnTjcL0huUlS849wgsE5oTXgdYb2hn+TXM5JJ +NsEXLhV09X1mrk4M4LV1npd0mYxvFsO4+p+IX5YLiahInmQtq0gx3DWE8wouVFER +4yzfp27z8MZT8Qvr/ZI9lzWd +-----END PRIVATE KEY----- diff --git a/ext/ftp/tests/server.inc b/ext/ftp/tests/server.inc index bb0c1ff10bec9..1a04cd179bedd 100644 --- a/ext/ftp/tests/server.inc +++ b/ext/ftp/tests/server.inc @@ -2,7 +2,7 @@ $socket = null; $errno = 0; -$context = stream_context_create(array('ssl' => array('local_cert' => dirname(__FILE__).'/cert.pem', 'passphrase' => 'pass'))); +$context = stream_context_create(array('ssl' => array('local_cert' => dirname(__FILE__).'/cert.pem'))); for ($i=0; $i<10 && !$socket; ++$i) { $port = rand(50000, 65535); @@ -139,7 +139,10 @@ if ($pid) { $buf = fread($s, 2048); } - if (!preg_match('/^USER (\w+)\r\n$/', $buf, $m)) { + if ($buf == "AUTH TLS\r\n") { + fputs($s, "500 not supported.\r\n"); + return ; + } else if (!preg_match('/^USER (\w+)\r\n$/', $buf, $m)) { fputs($s, "500 Syntax error, command unrecognized.\r\n"); dump_and_exit($buf); } @@ -208,6 +211,10 @@ if ($pid) { $ascii = true; fputs($s, "200 OK\r\n"); + } elseif ($buf === "AUTH SSL\r\n") { + $ascii = true; + fputs($s, "500 not supported\r\n"); + } elseif ($buf === "TYPE I\r\n") { $ascii = false; fputs($s, "200 OK\r\n"); @@ -265,7 +272,7 @@ if ($pid) { } elseif (preg_match("~^NLST(?: ([A-Za-z./]+))?\r\n$~", $buf, $m)) { - if (isset($m[1]) && $m[1] === 'bogusdir') { + if (isset($m[1]) && (($m[1] === 'bogusdir') || ($m[1] === '/bogusdir'))) { fputs($s, "250 $m[1]: No such file or directory\r\n"); continue; } @@ -276,11 +283,20 @@ if ($pid) { continue; } - fputs($s, "150 File status okay; about to open data connection\r\n"); + if (empty($pasv)) { + fputs($s, "150 File status okay; about to open data connection\r\n"); + if (!$fs = stream_socket_client("tcp://$host:$port")) { + fputs($s, "425 Can't open data connection\r\n"); + continue; + } + } else { + fputs($s, "125 Data connection already open; transfer starting.\r\n"); + $fs=$pasvs; + } - if (!$fs = stream_socket_client("tcp://$host:$port")) { - fputs($s, "425 Can't open data connection\r\n"); - continue; + + if ((!empty($ssl)) && (!stream_socket_enable_crypto($pasvs, true, STREAM_CRYPTO_METHOD_SSLv23_SERVER))) { + die("SSLv23 handshake failed.\n"); } if (empty($m[1]) || $m[1] !== 'emptydir') { @@ -368,7 +384,7 @@ if ($pid) { } fputs($s, "226 Closing data Connection.\r\n"); break; - case "mediumfile": + case "mediumfile": fputs($s, "150 File status okay; about to open data connection.\r\n"); for($i = 0; $i < 150; $i++){ fputs($fs, "This is line $i of the test data.\n"); @@ -384,13 +400,22 @@ if ($pid) { }elseif (preg_match('/^PASV/', $buf, $matches)) { - $port = $pasv_port; - $p2 = $port % ((int) 1 << 8); - $p1 = ($port-$p2)/((int) 1 << 8); + $pasv=true; + $p2 = $pasv_port % ((int) 1 << 8); + $p1 = ($pasv_port-$p2)/((int) 1 << 8); $host = "127.0.0.1"; + if (!empty($ssl)) { + $soc = stream_socket_server("tcp://127.0.0.1:$pasv_port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context); + } else { + $soc = stream_socket_server("tcp://127.0.0.1:$pasv_port"); + } + fputs($s, "227 Entering Passive Mode. (127,0,0,1,{$p1},{$p2})\r\n"); + $pasvs = stream_socket_accept($soc,10); + }elseif (preg_match('/^EPSV/', $buf, $matches)) { + fputs($s, "550 Extended passsive mode not supported.\r\n"); } elseif (preg_match('/^SITE EXEC/', $buf, $matches)) { fputs($s, "200 OK\r\n"); diff --git a/ext/gd/gd.c b/ext/gd/gd.c index cb070abf84cd4..afd3765f1525f 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -69,6 +69,9 @@ static void php_free_ps_enc(zend_rsrc_list_entry *rsrc TSRMLS_DC); #endif #include +#ifndef HAVE_GD_BUNDLED +# include +#endif #include /* 1 Tiny font */ #include /* 2 Small font */ #include /* 3 Medium bold font */ @@ -96,7 +99,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int, int); #include "gd_ctx.c" -/* as it is not really public, duplicate declaration here to avoid +/* as it is not really public, duplicate declaration here to avoid pointless warnings */ int overflow2(int a, int b); @@ -1099,6 +1102,18 @@ void php_gd_error_method(int type, const char *format, va_list args) { TSRMLS_FETCH(); + switch (type) { + case GD_DEBUG: + case GD_INFO: + case GD_NOTICE: + type = E_NOTICE; + break; + case GD_WARNING: + type = E_WARNING; + break; + default: + type = E_ERROR; + } php_verror(NULL, "", type, format, args TSRMLS_CC); } /* }}} */ @@ -1148,6 +1163,7 @@ PHP_MINIT_FUNCTION(gd) REGISTER_LONG_CONSTANT("IMG_PNG", 4, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_WBMP", 8, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_XPM", 16, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("IMG_WEBP", 32, CONST_CS | CONST_PERSISTENT); /* special colours for gd */ REGISTER_LONG_CONSTANT("IMG_COLOR_TILED", gdTiled, CONST_CS | CONST_PERSISTENT); @@ -1181,7 +1197,7 @@ PHP_MINIT_FUNCTION(gd) REGISTER_LONG_CONSTANT("IMG_CROP_SIDES", GD_CROP_SIDES, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_CROP_THRESHOLD", GD_CROP_THRESHOLD, CONST_CS | CONST_PERSISTENT); - + REGISTER_LONG_CONSTANT("IMG_BELL", GD_BELL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_BESSEL", GD_BESSEL, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("IMG_BILINEAR_FIXED", GD_BILINEAR_FIXED, CONST_CS | CONST_PERSISTENT); @@ -1539,6 +1555,7 @@ PHP_FUNCTION(imagesetstyle) int * stylearr; int index; HashPosition pos; + int num_styles; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ra", &IM, &styles) == FAILURE) { return; @@ -1546,8 +1563,14 @@ PHP_FUNCTION(imagesetstyle) ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); + num_styles = zend_hash_num_elements(HASH_OF(styles)); + if (num_styles == 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "styles array must not be empty"); + RETURN_FALSE; + } + /* copy the style values in the stylearr */ - stylearr = safe_emalloc(sizeof(int), zend_hash_num_elements(HASH_OF(styles)), 0); + stylearr = safe_emalloc(sizeof(int), num_styles, 0); zend_hash_internal_pointer_reset_ex(HASH_OF(styles), &pos); @@ -1635,11 +1658,11 @@ PHP_FUNCTION(imagetruecolortopalette) ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); - if (ncolors <= 0) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of colors has to be greater than zero"); + if (ncolors <= 0 || ncolors > INT_MAX) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Number of colors has to be greater than zero and no more than %d", INT_MAX); RETURN_FALSE; } - gdImageTrueColorToPalette(im, dither, ncolors); + gdImageTrueColorToPalette(im, dither, (int)ncolors); RETURN_TRUE; } @@ -2200,6 +2223,9 @@ PHP_FUNCTION(imagetypes) #if defined(HAVE_GD_XPM) ret |= 16; #endif +#ifdef HAVE_GD_WEBP + ret |= 32; +#endif if (zend_parse_parameters_none() == FAILURE) { return; @@ -3056,6 +3082,11 @@ PHP_FUNCTION(imagegammacorrect) return; } + if ( input <= 0.0 || output <= 0.0 ) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Gamma values should be positive"); + RETURN_FALSE; + } + ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); if (gdImageTrueColor(im)) { @@ -3887,7 +3918,7 @@ static void php_imagettftext_common(INTERNAL_FUNCTION_PARAMETERS, int mode, int #endif /* VIRTUAL_DIR */ PHP_GD_CHECK_OPEN_BASEDIR(fontname, "Invalid font filename"); - + #ifdef HAVE_GD_FREETYPE if (extended) { error = gdImageStringFTEx(im, brect, col, fontname, ptsize, angle, x, y, str, &strex); @@ -4465,7 +4496,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) int x, y; float x_ratio, y_ratio; long ignore_warning; - + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pplll", &f_org, &f_org_len, &f_dest, &f_dest_len, &height, &width, &threshold) == FAILURE) { return; } @@ -4499,6 +4530,7 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) dest = VCWD_FOPEN(fn_dest, "wb"); if (!dest) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing", fn_dest); + fclose(org); RETURN_FALSE; } @@ -4507,6 +4539,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) im_org = gdImageCreateFromGif(org); if (im_org == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid GIF file", fn_dest); + fclose(org); + fclose(dest); RETURN_FALSE; } break; @@ -4517,6 +4551,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) im_org = gdImageCreateFromJpegEx(org, ignore_warning); if (im_org == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid JPEG file", fn_dest); + fclose(org); + fclose(dest); RETURN_FALSE; } break; @@ -4527,6 +4563,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) im_org = gdImageCreateFromPng(org); if (im_org == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' Not a valid PNG file", fn_dest); + fclose(org); + fclose(dest); RETURN_FALSE; } break; @@ -4534,10 +4572,14 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Format not supported"); + fclose(org); + fclose(dest); RETURN_FALSE; break; } + fclose(org); + org_width = gdImageSX (im_org); org_height = gdImageSY (im_org); @@ -4568,6 +4610,8 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) im_tmp = gdImageCreate (dest_width, dest_height); if (im_tmp == NULL ) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate temporary buffer"); + fclose(dest); + gdImageDestroy(im_org); RETURN_FALSE; } @@ -4575,23 +4619,29 @@ static void _php_image_convert(INTERNAL_FUNCTION_PARAMETERS, int image_type ) gdImageDestroy(im_org); - fclose(org); - im_dest = gdImageCreate(dest_width, dest_height); if (im_dest == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate destination buffer"); + fclose(dest); + gdImageDestroy(im_tmp); RETURN_FALSE; } white = gdImageColorAllocate(im_dest, 255, 255, 255); if (white == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); + fclose(dest); + gdImageDestroy(im_tmp); + gdImageDestroy(im_dest); RETURN_FALSE; } black = gdImageColorAllocate(im_dest, 0, 0, 0); if (black == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate the colors for the destination buffer"); + fclose(dest); + gdImageDestroy(im_tmp); + gdImageDestroy(im_dest); RETURN_FALSE; } @@ -5097,7 +5147,7 @@ PHP_FUNCTION(imagecropauto) break; case GD_CROP_THRESHOLD: - if (color < 0) { + if (color < 0 || (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color argument missing with threshold mode"); RETURN_FALSE; } @@ -5348,7 +5398,7 @@ PHP_FUNCTION(imageaffinematrixget) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Missing y position"); RETURN_FALSE; } - + if (type == GD_AFFINE_TRANSLATE) { res = gdAffineTranslate(affine, x, y); } else { diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index a5799c59d55af..0b4b42fa27558 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -190,7 +190,7 @@ gdImagePtr gdImageCreateTrueColor (int sx, int sy) return NULL; } - if (overflow2(sizeof(int), sx)) { + if (overflow2(sizeof(int *), sx)) { return NULL; } @@ -599,15 +599,18 @@ void gdImageColorDeallocate (gdImagePtr im, int color) void gdImageColorTransparent (gdImagePtr im, int color) { + if (color < 0) { + return; + } if (!im->trueColor) { + if((color >= im->colorsTotal)) { + return; + } + /* Make the old transparent color opaque again */ if (im->transparent != -1) { im->alpha[im->transparent] = gdAlphaOpaque; } - if (color > -1 && color < im->colorsTotal && color < gdMaxColors) { - im->alpha[color] = gdAlphaTransparent; - } else { - return; - } + im->alpha[color] = gdAlphaTransparent; } im->transparent = color; } @@ -1667,23 +1670,17 @@ long lsqrt (long n) /* s and e are integers modulo 360 (degrees), with 0 degrees being the rightmost extreme and degrees changing clockwise. cx and cy are the center in pixels; w and h are the horizontal - and vertical diameter in pixels. Nice interface, but slow. - See gd_arc_f_buggy.c for a better version that doesn't - seem to be bug-free yet. */ + and vertical diameter in pixels. */ void gdImageArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color) { - if ((s % 360) == (e % 360)) { - gdImageEllipse(im, cx, cy, w, h, color); - } else { - gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill); - } + gdImageFilledArc(im, cx, cy, w, h, s, e, color, gdNoFill); } void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e, int color, int style) { - gdPoint pts[3]; - int i; + gdPoint pts[363]; + int i, pti; int lx = 0, ly = 0; int fx = 0, fy = 0; @@ -1711,7 +1708,7 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e } } - for (i = s; i <= e; i++) { + for (i = s, pti = 1; i <= e; i++, pti++) { int x, y; x = ((long) gdCosT[i % 360] * (long) w / (2 * 1024)) + cx; y = ((long) gdSinT[i % 360] * (long) h / (2 * 1024)) + cy; @@ -1720,19 +1717,28 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e if (style & gdNoFill) { gdImageLine(im, lx, ly, x, y, color); } else { - /* This is expensive! */ - pts[0].x = lx; - pts[0].y = ly; - pts[1].x = x; - pts[1].y = y; - pts[2].x = cx; - pts[2].y = cy; - gdImageFilledPolygon(im, pts, 3, color); - } + if (y == ly) { + pti--; /* don't add this point */ + if (((i > 270 || i < 90) && x > lx) || ((i > 90 && i < 270) && x < lx)) { + /* replace the old x coord, if increasing on the + right side or decreasing on the left side */ + pts[pti].x = x; + } + } else { + pts[pti].x = x; + pts[pti].y = y; + } + } } } else { fx = x; fy = y; + if (!(style & (gdChord | gdNoFill))) { + pts[0].x = cx; + pts[0].y = cy; + pts[pti].x = x; + pts[pti].y = y; + } } lx = x; ly = y; @@ -1759,6 +1765,10 @@ void gdImageFilledArc (gdImagePtr im, int cx, int cy, int w, int h, int s, int e gdImageLine(im, cx, cy, lx, ly, color); gdImageLine(im, cx, cy, fx, fy, color); } + } else { + pts[pti].x = cx; + pts[pti].y = cy; + gdImageFilledPolygon(im, pts, pti+1, color); } } } @@ -2237,7 +2247,9 @@ void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, for (y = 0; (y < h); y++) { for (x = 0; (x < w); x++) { int c = gdImageGetTrueColorPixel (src, srcX + x, srcY + y); - gdImageSetPixel (dst, dstX + x, dstY + y, c); + if (c != src->transparent) { + gdImageSetPixel (dst, dstX + x, dstY + y, c); + } } } } else { @@ -2254,26 +2266,6 @@ void gdImageCopy (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, return; } - /* Destination is palette based */ - if (src->trueColor) { /* But source is truecolor (Ouch!) */ - toy = dstY; - for (y = srcY; (y < (srcY + h)); y++) { - tox = dstX; - for (x = srcX; x < (srcX + w); x++) { - int nc; - c = gdImageGetPixel (src, x, y); - - /* Get best match possible. */ - nc = gdImageColorResolveAlpha(dst, gdTrueColorGetRed(c), gdTrueColorGetGreen(c), gdTrueColorGetBlue(c), gdTrueColorGetAlpha(c)); - - gdImageSetPixel(dst, tox, toy, nc); - tox++; - } - toy++; - } - return; - } - /* Palette based to palette based */ for (i = 0; i < gdMaxColors; i++) { colorMap[i] = (-1); diff --git a/ext/gd/libgd/gd_gif_out.c b/ext/gd/libgd/gd_gif_out.c index 14045385ab834..0178dd9741dc4 100644 --- a/ext/gd/libgd/gd_gif_out.c +++ b/ext/gd/libgd/gd_gif_out.c @@ -601,14 +601,26 @@ compress(int init_bits, gdIOCtxPtr outfile, gdImagePtr im, GifCtx *ctx) * code in turn. When the buffer fills up empty it and start over. */ -static unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, +static const unsigned long masks[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; + +/* Arbitrary value to mark output is done. When we see EOFCode, then we don't + * expect to see any more data. If we do (e.g. corrupt image inputs), cur_bits + * might be negative, so flag it to return early. + */ +#define CUR_BITS_FINISHED -1000 + + static void output(code_int code, GifCtx *ctx) { + if (ctx->cur_bits == CUR_BITS_FINISHED) { + return; + } + ctx->cur_accum &= masks[ ctx->cur_bits ]; if( ctx->cur_bits > 0 ) @@ -655,8 +667,10 @@ output(code_int code, GifCtx *ctx) ctx->cur_bits -= 8; } - flush_char(ctx); + /* Flag that it's done to prevent re-entry. */ + ctx->cur_bits = CUR_BITS_FINISHED; + flush_char(ctx); } } diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index 83319966f97e9..4c11213a8eb71 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -879,20 +879,42 @@ int getPixelInterpolated(gdImagePtr im, const double x, const double y, const in static inline LineContribType * _gdContributionsAlloc(unsigned int line_length, unsigned int windows_size) { unsigned int u = 0; - LineContribType *res; + LineContribType *res; + int overflow_error = 0; res = (LineContribType *) gdMalloc(sizeof(LineContribType)); if (!res) { return NULL; } - res->WindowSize = windows_size; - res->LineLength = line_length; - res->ContribRow = (ContributionType *) gdMalloc(line_length * sizeof(ContributionType)); - - for (u = 0 ; u < line_length ; u++) { - res->ContribRow[u].Weights = (double *) gdMalloc(windows_size * sizeof(double)); - } - return res; + res->WindowSize = windows_size; + res->LineLength = line_length; + if (overflow2(line_length, sizeof(ContributionType))) { + gdFree(res); + return NULL; + } + res->ContribRow = (ContributionType *) gdMalloc(line_length * sizeof(ContributionType)); + if (res->ContribRow == NULL) { + gdFree(res); + return NULL; + } + for (u = 0 ; u < line_length ; u++) { + if (overflow2(windows_size, sizeof(double))) { + overflow_error = 1; + } else { + res->ContribRow[u].Weights = (double *) gdMalloc(windows_size * sizeof(double)); + } + if (overflow_error == 1 || res->ContribRow[u].Weights == NULL) { + unsigned int i; + u--; + for (i=0;i<=u;i++) { + gdFree(res->ContribRow[i].Weights); + } + gdFree(res->ContribRow); + gdFree(res); + return NULL; + } + } + return res; } static inline void _gdContributionsFree(LineContribType * p) @@ -907,59 +929,62 @@ static inline void _gdContributionsFree(LineContribType * p) static inline LineContribType *_gdContributionsCalc(unsigned int line_size, unsigned int src_size, double scale_d, const interpolation_method pFilter) { - double width_d; - double scale_f_d = 1.0; - const double filter_width_d = DEFAULT_BOX_RADIUS; + double width_d; + double scale_f_d = 1.0; + const double filter_width_d = DEFAULT_BOX_RADIUS; int windows_size; unsigned int u; LineContribType *res; + int overflow_error = 0; - if (scale_d < 1.0) { - width_d = filter_width_d / scale_d; - scale_f_d = scale_d; - } else { - width_d= filter_width_d; - } - - windows_size = 2 * (int)ceil(width_d) + 1; - res = _gdContributionsAlloc(line_size, windows_size); + if (scale_d < 1.0) { + width_d = filter_width_d / scale_d; + scale_f_d = scale_d; + } else { + width_d= filter_width_d; + } - for (u = 0; u < line_size; u++) { - const double dCenter = (double)u / scale_d; - /* get the significant edge points affecting the pixel */ - register int iLeft = MAX(0, (int)floor (dCenter - width_d)); - int iRight = MIN((int)ceil(dCenter + width_d), (int)src_size - 1); - double dTotalWeight = 0.0; + windows_size = 2 * (int)ceil(width_d) + 1; + res = _gdContributionsAlloc(line_size, windows_size); + if (res == NULL) { + return NULL; + } + for (u = 0; u < line_size; u++) { + const double dCenter = (double)u / scale_d; + /* get the significant edge points affecting the pixel */ + register int iLeft = MAX(0, (int)floor (dCenter - width_d)); + int iRight = MIN((int)ceil(dCenter + width_d), (int)src_size - 1); + double dTotalWeight = 0.0; int iSrc; - /* Cut edge points to fit in filter window in case of spill-off */ - if (iRight - iLeft + 1 > windows_size) { - if (iLeft < ((int)src_size - 1 / 2)) { - iLeft++; - } else { - iRight--; - } - } + /* Cut edge points to fit in filter window in case of spill-off */ + if (iRight - iLeft + 1 > windows_size) { + if (iLeft < ((int)src_size - 1 / 2)) { + iLeft++; + } else { + iRight--; + } + } - res->ContribRow[u].Left = iLeft; - res->ContribRow[u].Right = iRight; + res->ContribRow[u].Left = iLeft; + res->ContribRow[u].Right = iRight; - for (iSrc = iLeft; iSrc <= iRight; iSrc++) { - dTotalWeight += (res->ContribRow[u].Weights[iSrc-iLeft] = scale_f_d * (*pFilter)(scale_f_d * (dCenter - (double)iSrc))); - } + for (iSrc = iLeft; iSrc <= iRight; iSrc++) { + dTotalWeight += (res->ContribRow[u].Weights[iSrc-iLeft] = scale_f_d * (*pFilter)(scale_f_d * (dCenter - (double)iSrc))); + } if (dTotalWeight < 0.0) { _gdContributionsFree(res); return NULL; } - if (dTotalWeight > 0.0) { - for (iSrc = iLeft; iSrc <= iRight; iSrc++) { - res->ContribRow[u].Weights[iSrc-iLeft] /= dTotalWeight; - } - } - } - return res; + if (dTotalWeight > 0.0) { + for (iSrc = iLeft; iSrc <= iRight; iSrc++) { + res->ContribRow[u].Weights[iSrc-iLeft] /= dTotalWeight; + } + } + } + return res; } static inline void _gdScaleRow(gdImagePtr pSrc, unsigned int src_width, gdImagePtr dst, unsigned int dst_width, unsigned int row, LineContribType *contrib) @@ -1244,7 +1269,13 @@ static gdImagePtr gdImageScaleBilinearPalette(gdImagePtr im, const unsigned int if (new_img == NULL) { return NULL; } - new_img->transparent = gdTrueColorAlpha(im->red[transparent], im->green[transparent], im->blue[transparent], im->alpha[transparent]); + + if (transparent < 0) { + /* uninitialized */ + new_img->transparent = -1; + } else { + new_img->transparent = gdTrueColorAlpha(im->red[transparent], im->green[transparent], im->blue[transparent], im->alpha[transparent]); + } for (i=0; i < _height; i++) { long j; @@ -1478,13 +1509,8 @@ gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, co src_offset_y[0] = m; } - if (m < 1) { - src_offset_x[1] = n; - src_offset_y[1] = m; - } else { - src_offset_x[1] = n; - src_offset_y[1] = m; - } + src_offset_x[1] = n; + src_offset_y[1] = m; if ((m < 1) || (n >= src_w - 1)) { src_offset_x[2] = n; @@ -1536,13 +1562,8 @@ gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, co src_offset_y[8] = m; } - if (m >= src_h - 1) { - src_offset_x[8] = n; - src_offset_y[8] = m; - } else { - src_offset_x[9] = n; - src_offset_y[9] = m; - } + src_offset_x[9] = n; + src_offset_y[9] = m; if ((m >= src_h-1) || (n >= src_w-1)) { src_offset_x[10] = n; @@ -1568,13 +1589,8 @@ gdImagePtr gdImageScaleBicubicFixed(gdImagePtr src, const unsigned int width, co src_offset_y[12] = m; } - if (m >= src_h - 2) { - src_offset_x[13] = n; - src_offset_y[13] = m; - } else { - src_offset_x[13] = n; - src_offset_y[13] = m; - } + src_offset_x[13] = n; + src_offset_y[13] = m; if ((m >= src_h - 2) || (n >= src_w - 1)) { src_offset_x[14] = n; @@ -1983,13 +1999,8 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const src_offset_y[0] = m; } - if (m < 1) { - src_offset_x[1] = n; - src_offset_y[1] = m; - } else { - src_offset_x[1] = n; - src_offset_y[1] = m ; - } + src_offset_x[1] = n; + src_offset_y[1] = m; if ((m < 1) || (n >= src_w-1)) { src_offset_x[2] = - 1; @@ -2042,8 +2053,8 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const } if (m >= src_h-1) { - src_offset_x[8] = - 1; - src_offset_y[8] = - 1; + src_offset_x[9] = - 1; + src_offset_y[9] = - 1; } else { src_offset_x[9] = n; src_offset_y[9] = m; diff --git a/ext/gd/libgd/gdkanji.c b/ext/gd/libgd/gdkanji.c index 37f3bd10a079b..be853c542d56c 100644 --- a/ext/gd/libgd/gdkanji.c +++ b/ext/gd/libgd/gdkanji.c @@ -330,7 +330,7 @@ han2zen (int *p1, int *p2) { if ((*p2 >= 74 && *p2 <= 103) || (*p2 >= 110 && *p2 <= 122)) (*p2)++; - else if (*p2 == 131 && *p2 == 69) + else if (*p2 == 131 || *p2 == 69) *p2 = 148; } else if (handaku && *p2 >= 110 && *p2 <= 122) diff --git a/ext/gd/tests/bug22544.phpt b/ext/gd/tests/bug22544.phpt index 4c8f763a7348b..b18eef4332ffa 100644 --- a/ext/gd/tests/bug22544.phpt +++ b/ext/gd/tests/bug22544.phpt @@ -15,9 +15,9 @@ Bug #22544 (TrueColor transparency in PNG images). $red = imageColorAllocate($image, 255, 50, 50); imageColorTransparent($image, $transparent); imageFilledRectangle($image, 0, 0, 640-1, 100-1, $transparent); - imagePng($image, $dest); + imagegd($image, $dest); echo md5_file($dest) . "\n"; @unlink($dest); ?> --EXPECT-- -10a57d09a2c63fad87b85b38d6b258d6 +7643ef115f642a79c2de6e411f485ddd diff --git a/ext/gd/tests/bug43121.phpt b/ext/gd/tests/bug43121.phpt index ce2d1d6f6fcf7..feb10267c2322 100644 --- a/ext/gd/tests/bug43121.phpt +++ b/ext/gd/tests/bug43121.phpt @@ -3,6 +3,9 @@ Bug #43121 (gdImageFill with IMG_COLOR_TILED crashes httpd) --SKIPIF-- --FILE-- --FILE-- +--FILE-- + +--EXPECT-- +2400a58cd7570b5472c25264715321cd diff --git a/ext/gd/tests/bug53154.phpt b/ext/gd/tests/bug53154.phpt index 6cbae2016ce88..0c5ee9cc99e95 100644 --- a/ext/gd/tests/bug53154.phpt +++ b/ext/gd/tests/bug53154.phpt @@ -3,6 +3,9 @@ Bug #53154 (Zero-height rectangle has whiskers) --SKIPIF-- --FILE-- --FILE-- --FILE-- +--FILE-- + +==DONE== +--EXPECT-- +9b36049de01006b367efd433f1689043 +==DONE== diff --git a/ext/gd/tests/bug66387.phpt b/ext/gd/tests/bug66387.phpt index 79c49a527b457..04ab0b688e293 100644 --- a/ext/gd/tests/bug66387.phpt +++ b/ext/gd/tests/bug66387.phpt @@ -3,6 +3,9 @@ Bug #66387 (Stack overflow with imagefilltoborder) --SKIPIF-- --FILE-- --FILE-- --FILE-- diff --git a/ext/gd/tests/bug72339.phpt b/ext/gd/tests/bug72339.phpt index 2c30ee8a74e2e..c8862833464ad 100644 --- a/ext/gd/tests/bug72339.phpt +++ b/ext/gd/tests/bug72339.phpt @@ -1,7 +1,12 @@ --TEST-- Bug #72339 Integer Overflow in _gd2GetHeader() resulting in heap overflow --SKIPIF-- - + --FILE-- +--FILE-- + +--EXPECT-- +OK + diff --git a/ext/gd/tests/bug72512_0.phpt b/ext/gd/tests/bug72512_0.phpt new file mode 100644 index 0000000000000..565d60a6329f5 --- /dev/null +++ b/ext/gd/tests/bug72512_0.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access, var 0 +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECT-- +==DONE== diff --git a/ext/gd/tests/bug72512_1.phpt b/ext/gd/tests/bug72512_1.phpt new file mode 100644 index 0000000000000..2983ff29b89de --- /dev/null +++ b/ext/gd/tests/bug72512_1.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access, var 1 +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECT-- +==DONE== diff --git a/ext/gd/tests/bug72596.phpt b/ext/gd/tests/bug72596.phpt new file mode 100644 index 0000000000000..2eb7dadb76c48 --- /dev/null +++ b/ext/gd/tests/bug72596.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #72596 (imagetypes function won't advertise WEBP support) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) diff --git a/ext/gd/tests/bug72604.phpt b/ext/gd/tests/bug72604.phpt new file mode 100644 index 0000000000000..edc3ce327f190 --- /dev/null +++ b/ext/gd/tests/bug72604.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #72604 (imagearc() ignores thickness for full arcs) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +4f5080080a774efe4fc8d55cd4a5849c diff --git a/ext/gd/tests/bug72697.phpt b/ext/gd/tests/bug72697.phpt new file mode 100644 index 0000000000000..6110385fcb807 --- /dev/null +++ b/ext/gd/tests/bug72697.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #72697: select_colors write out-of-bounds +--SKIPIF-- + +--FILE-- + +DONE +--EXPECTF-- +Warning: imagetruecolortopalette(): Number of colors has to be greater than zero and no more than 2147483647 in %sbug72697.php on line %d +DONE \ No newline at end of file diff --git a/ext/gd/tests/bug72709.phpt b/ext/gd/tests/bug72709.phpt new file mode 100644 index 0000000000000..1c5b1f4ae0420 --- /dev/null +++ b/ext/gd/tests/bug72709.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #72709 (imagesetstyle() causes OOB read for empty $styles) +--SKIPIF-- + +--FILE-- + +====DONE==== +--EXPECTF-- +Warning: imagesetstyle(): styles array must not be empty in %s%ebug72709.php on line %d +bool(false) +====DONE==== diff --git a/ext/gd/tests/bug72730.phpt b/ext/gd/tests/bug72730.phpt new file mode 100644 index 0000000000000..e7c13cb5e9d0a --- /dev/null +++ b/ext/gd/tests/bug72730.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #72730: imagegammacorrect allows arbitrary write access +--SKIPIF-- + +--FILE-- + +DONE +--EXPECTF-- +Warning: imagegammacorrect(): Gamma values should be positive in %sbug72730.php on line %d +DONE \ No newline at end of file diff --git a/ext/gd/tests/bug72913.phpt b/ext/gd/tests/bug72913.phpt new file mode 100644 index 0000000000000..0ad03a7d3c103 --- /dev/null +++ b/ext/gd/tests/bug72913.phpt @@ -0,0 +1,29 @@ +--TEST-- +Bug #72913 (imagecopy() loses single-color transparency on palette images) +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECT-- +f03c27f20710e21debd7090c660f1a1e +==DONE== diff --git a/ext/gd/tests/gd_info_variation1.phpt b/ext/gd/tests/gd_info_variation1.phpt index a725f6554d9d5..8fa1f4903eceb 100644 --- a/ext/gd/tests/gd_info_variation1.phpt +++ b/ext/gd/tests/gd_info_variation1.phpt @@ -25,26 +25,28 @@ var_dump(gd_info()); *** Testing gd_info() : variation *** array(%d) { ["GD Version"]=> - string(%d) %a + string(%d) %s ["FreeType Support"]=> - bool%a + bool(%a ["T1Lib Support"]=> - bool%a + bool(%s) ["GIF Read Support"]=> - bool%a + bool(%s) ["GIF Create Support"]=> - bool%a + bool(%s) ["JPEG Support"]=> - bool%a + bool(%s) ["PNG Support"]=> - bool%a + bool(%s) ["WBMP Support"]=> - bool%a + bool(%s) ["XPM Support"]=> - bool%a + bool(%s) ["XBM Support"]=> - bool%a + bool(%s) + ["WebP Support"]=> + bool(%s) ["JIS-mapped Japanese Font Support"]=> - bool%a + bool(%s) } ===DONE=== \ No newline at end of file diff --git a/ext/gd/tests/github_bug_215.phpt b/ext/gd/tests/github_bug_215.phpt index f44a5401e182c..8657f95d76866 100644 --- a/ext/gd/tests/github_bug_215.phpt +++ b/ext/gd/tests/github_bug_215.phpt @@ -3,6 +3,9 @@ Github #215 (imagefilltoborder stack overflow when invalid pallete index used) --SKIPIF-- --FILE-- --EXPECT-- -f18ad8001afefee2e9b8c08d6884425b +13149c3fd54a92a0d43cd5083a19b1d7 diff --git a/ext/gd/tests/imagearc_error1.phpt b/ext/gd/tests/imagearc_error1.phpt index 423f0356af974..05d1cd8186d37 100644 --- a/ext/gd/tests/imagearc_error1.phpt +++ b/ext/gd/tests/imagearc_error1.phpt @@ -18,7 +18,7 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); imagearc($image, 50, 50, 30, 30, 0, 180); ob_start(); -imagepng($image); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); @@ -26,4 +26,4 @@ echo md5(base64_encode($img)); ?> --EXPECTF-- Warning: imagearc() expects exactly 8 parameters, 7 given in %s on line %d -abebb25b5a2813cfbf92f1f24365786a +c5b7013900f5466aebfc42499a7ec8ec diff --git a/ext/gd/tests/imagearc_variation1.phpt b/ext/gd/tests/imagearc_variation1.phpt index 568d3a6d47b90..aaf6103b4381b 100644 --- a/ext/gd/tests/imagearc_variation1.phpt +++ b/ext/gd/tests/imagearc_variation1.phpt @@ -18,11 +18,11 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); imagearc($image, 50, 50, 30, 30, 0, -90, $white); ob_start(); -imagepng($image); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -ed2c8427a9922dfd8a105f10a88a0d20 +fe662ebe7488057c43e38c5de43b1727 diff --git a/ext/gd/tests/imagearc_variation2.phpt b/ext/gd/tests/imagearc_variation2.phpt index 045c68e61c20f..0c1c6466e14df 100644 --- a/ext/gd/tests/imagearc_variation2.phpt +++ b/ext/gd/tests/imagearc_variation2.phpt @@ -18,11 +18,11 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); imagearc($image, 50, 50, 30, 30, -90, 0, $white); ob_start(); -imagepng($image); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -463b4aea9d9acfab30016ee92613c779 +8bd78aa775b5f29e7227eaeebaa84889 diff --git a/ext/gd/tests/imagechar_basic.phpt b/ext/gd/tests/imagechar_basic.phpt index 7e5fa931bcf2d..fa6dd4d93520a 100644 --- a/ext/gd/tests/imagechar_basic.phpt +++ b/ext/gd/tests/imagechar_basic.phpt @@ -15,11 +15,11 @@ $white = imagecolorallocate($image, 255,255,255); $result = imagechar($image, 1, 5, 5, 'C', $white); ob_start(); -imagepng($image, null, 9); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -e94962ac28ad03bd4142cb1abe9ef98b +f0291252e7ac2fadda25e63287e6860c diff --git a/ext/gd/tests/imagecharup_basic.phpt b/ext/gd/tests/imagecharup_basic.phpt index 54c8dfaa4a561..194c32564ddbe 100644 --- a/ext/gd/tests/imagecharup_basic.phpt +++ b/ext/gd/tests/imagecharup_basic.phpt @@ -15,11 +15,11 @@ $white = imagecolorallocate($image, 255,255,255); $result = imagecharup($image, 1, 5, 5, 'C', $white); ob_start(); -imagepng($image, null, 9); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -79b48d5cef6d489bb68573df0296d775 +c65aad5d78f934dee2a844e7978eabd5 diff --git a/ext/gd/tests/imagecolorallocatealpha_basic.phpt b/ext/gd/tests/imagecolorallocatealpha_basic.phpt index bdc417387fe7f..8595b405074e7 100644 --- a/ext/gd/tests/imagecolorallocatealpha_basic.phpt +++ b/ext/gd/tests/imagecolorallocatealpha_basic.phpt @@ -5,6 +5,9 @@ Rafael Dohms --SKIPIF-- --FILE-- --EXPECT-- -string(32) "2a6424e4cb4e1b7391dfff74bf136bde" +string(32) "0981ef94ee2209a8dccb59aa8ad07e18" int(842163455) \ No newline at end of file diff --git a/ext/gd/tests/imagecolorset_basic.phpt b/ext/gd/tests/imagecolorset_basic.phpt index a1776ff50fceb..01e5f7bfd585d 100644 --- a/ext/gd/tests/imagecolorset_basic.phpt +++ b/ext/gd/tests/imagecolorset_basic.phpt @@ -25,11 +25,11 @@ imagecolorset($im, $bg, 0, 0, 255); // Get output and generate md5 hash ob_start(); -imagepng($im, null, 9); +imagegd($im); $result_image = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($result_image)); imagedestroy($im); ?> --EXPECT-- -6f2002aafb57b2d275fad6a6258d7476 +85e406abd0a975c97b3403cad5d078c9 diff --git a/ext/gd/tests/imageconvolution_basic.phpt b/ext/gd/tests/imageconvolution_basic.phpt index 5a9aa8f95b3ec..9e629ac0e658d 100644 --- a/ext/gd/tests/imageconvolution_basic.phpt +++ b/ext/gd/tests/imageconvolution_basic.phpt @@ -23,11 +23,11 @@ $gaussian = array( imageconvolution($image, $gaussian, 16, 0); ob_start(); -imagepng($image, null, 9); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -594576a2a2a689447ffc07eb5a73f09b +20979b45f8772cdbd78262af4e332638 diff --git a/ext/gd/tests/imagecreatetruecolor_basic.phpt b/ext/gd/tests/imagecreatetruecolor_basic.phpt index 5c85f52380cba..a6eced15b338f 100644 --- a/ext/gd/tests/imagecreatetruecolor_basic.phpt +++ b/ext/gd/tests/imagecreatetruecolor_basic.phpt @@ -12,11 +12,11 @@ Rafael Dohms $image = imagecreatetruecolor(180, 30); ob_start(); -imagepng($image, null, 9); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -5a8fe9864cbd20e5dbe730c77f30db95 +da884f488a851e0267a316ad232aee86 diff --git a/ext/gd/tests/imageellipse_basic.phpt b/ext/gd/tests/imageellipse_basic.phpt index bfd0b79f584e1..759e42ab72e4d 100644 --- a/ext/gd/tests/imageellipse_basic.phpt +++ b/ext/gd/tests/imageellipse_basic.phpt @@ -17,11 +17,11 @@ $image = imagecreatetruecolor(400, 300); imageellipse($image, 200, 150, 300, 200, 16777215); ob_start(); -imagepng($image, null, 9); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -d8b9bc2ca224bd68569413f4617f8e1f +49c1544b012c3460c74cd04f1332d4ad diff --git a/ext/gd/tests/imagefilledarc_basic.phpt b/ext/gd/tests/imagefilledarc_basic.phpt index 3357dd75aaddd..8c76a83406b78 100644 --- a/ext/gd/tests/imagefilledarc_basic.phpt +++ b/ext/gd/tests/imagefilledarc_basic.phpt @@ -6,6 +6,9 @@ Edgar Ferreira da Silva --SKIPIF-- --FILE-- --EXPECT-- -beffeaf5231adaaff1f21a2108fb6f7e +87637c60ac0ceea48dbcaa4d98319f90 diff --git a/ext/gd/tests/imagefilledarc_error1.phpt b/ext/gd/tests/imagefilledarc_error1.phpt index b2bc4172de33c..46d51ba34bbb8 100644 --- a/ext/gd/tests/imagefilledarc_error1.phpt +++ b/ext/gd/tests/imagefilledarc_error1.phpt @@ -18,7 +18,7 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); imagefilledarc($image, 50, 50, 30, 30, 0, 90, $white); ob_start(); -imagepng($image); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); @@ -26,4 +26,4 @@ echo md5(base64_encode($img)); ?> --EXPECTF-- Warning: imagefilledarc() expects exactly 9 parameters, 8 given in %s on line %d -abebb25b5a2813cfbf92f1f24365786a +c5b7013900f5466aebfc42499a7ec8ec diff --git a/ext/gd/tests/imagefilledarc_variation1.phpt b/ext/gd/tests/imagefilledarc_variation1.phpt index 2254b0910ff09..f4130a9c690a8 100644 --- a/ext/gd/tests/imagefilledarc_variation1.phpt +++ b/ext/gd/tests/imagefilledarc_variation1.phpt @@ -6,6 +6,9 @@ Edgar Ferreira da Silva --SKIPIF-- --FILE-- --EXPECT-- -b467492b806001c3720b3f18cfbde5b0 +f25f589b5c5fa7deead7242652919bcf diff --git a/ext/gd/tests/imagefilledarc_variation2.phpt b/ext/gd/tests/imagefilledarc_variation2.phpt index 57686ab64ce1c..033d6f65f05ee 100644 --- a/ext/gd/tests/imagefilledarc_variation2.phpt +++ b/ext/gd/tests/imagefilledarc_variation2.phpt @@ -6,6 +6,9 @@ Edgar Ferreira da Silva --SKIPIF-- --FILE-- --EXPECT-- -cfad369fc6d863785d3c95b4b4788225 +43c2973eb4872903eb6f5464c7965a93 diff --git a/ext/gd/tests/imagefilledellipse_basic.phpt b/ext/gd/tests/imagefilledellipse_basic.phpt index a1a578ad43f2f..8b3682bfa8524 100644 --- a/ext/gd/tests/imagefilledellipse_basic.phpt +++ b/ext/gd/tests/imagefilledellipse_basic.phpt @@ -15,11 +15,11 @@ $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF); imagefilledellipse($image, 50, 50, 40, 30, $white); ob_start(); -imagepng($image); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -9ba540bba1b78c9f08efaa6fa0afd93b +233beffe003a41d3c9e788039e3191dd diff --git a/ext/gd/tests/imagefilltoborder_basic.phpt b/ext/gd/tests/imagefilltoborder_basic.phpt index 80b84d2c6960b..524022a15db46 100644 --- a/ext/gd/tests/imagefilltoborder_basic.phpt +++ b/ext/gd/tests/imagefilltoborder_basic.phpt @@ -22,7 +22,7 @@ imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) ); imagefilltoborder( $image, 50, 50, imagecolorallocate( $image, 0, 0, 0 ), imagecolorallocate( $image, 255, 0, 0 ) ); ob_start(); -imagepng( $image, null, 9 ); +imagegd( $image); $img = ob_get_contents(); ob_end_clean(); @@ -30,4 +30,4 @@ echo md5(base64_encode($img)); ?> --EXPECT-- -847ec236f1c4d14c465306c8408550fc +8185a06ccff03c2abeb99d5e3ed60e45 diff --git a/ext/gd/tests/imagegammacorrect_basic.phpt b/ext/gd/tests/imagegammacorrect_basic.phpt index 33d6b1ad6c93d..b803e9517f522 100644 --- a/ext/gd/tests/imagegammacorrect_basic.phpt +++ b/ext/gd/tests/imagegammacorrect_basic.phpt @@ -6,6 +6,9 @@ Rafael Dohms --SKIPIF-- --FILE-- --EXPECT-- -e79553115df689ea5df18a4636380569 +1f625723f9d27251a1f15b83a6a4bf55 \ No newline at end of file diff --git a/ext/gd/tests/imagegammacorrect_variation1.phpt b/ext/gd/tests/imagegammacorrect_variation1.phpt index 7a321f89d87ef..a0df819a7d970 100644 --- a/ext/gd/tests/imagegammacorrect_variation1.phpt +++ b/ext/gd/tests/imagegammacorrect_variation1.phpt @@ -6,6 +6,9 @@ Rafael Dohms --SKIPIF-- --FILE-- --EXPECT-- -b017b1ddc8bda00e82aa8cbfb54c35d4 +32fdb7b3675e4a9fd601c6a0645c88b3 diff --git a/ext/gd/tests/imagelayereffect_basic.phpt b/ext/gd/tests/imagelayereffect_basic.phpt index a34e05e02f9cd..2f1ee47aafa88 100644 --- a/ext/gd/tests/imagelayereffect_basic.phpt +++ b/ext/gd/tests/imagelayereffect_basic.phpt @@ -16,7 +16,7 @@ $layer = imagelayereffect($image, IMG_EFFECT_REPLACE); if ($layer){ ob_start(); - imagepng($image, null, 9); + imagegd($image); $img = ob_get_contents(); ob_end_clean(); } @@ -24,4 +24,4 @@ if ($layer){ echo md5(base64_encode($img)); ?> --EXPECT-- -5a8fe9864cbd20e5dbe730c77f30db95 +da884f488a851e0267a316ad232aee86 diff --git a/ext/gd/tests/imagerectangle_basic.phpt b/ext/gd/tests/imagerectangle_basic.phpt index f706ee7ab6551..eaa1566f7f3ca 100644 --- a/ext/gd/tests/imagerectangle_basic.phpt +++ b/ext/gd/tests/imagerectangle_basic.phpt @@ -16,7 +16,7 @@ $image = imagecreatetruecolor( 100, 100 ); imagerectangle( $image, 0, 0, 50, 50, imagecolorallocate($image, 255, 255, 255) ); ob_start(); -imagepng( $image, null, 9 ); +imagegd( $image ); $img = ob_get_contents(); ob_end_clean(); @@ -24,4 +24,4 @@ echo md5(base64_encode($img)); ?> --EXPECT-- -282aaecfdd50091821d63093d9bb1bb9 \ No newline at end of file +e7f8ca8c63fb08b248f3ed6435983aed \ No newline at end of file diff --git a/ext/gd/tests/imagesetbrush_basic.phpt b/ext/gd/tests/imagesetbrush_basic.phpt index 790184ddc29c4..763a4c414d832 100644 --- a/ext/gd/tests/imagesetbrush_basic.phpt +++ b/ext/gd/tests/imagesetbrush_basic.phpt @@ -28,10 +28,10 @@ imageline($mainimg, 50, 50, 50, 60, IMG_COLOR_BRUSHED); // Get output and generate md5 hash ob_start(); -imagepng($mainimg, null, 9); +imagegd($mainimg); $result_image = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($result_image)); ?> --EXPECT-- -8168577c0d1fe6d9d11397cb15263d82 +2bb294c388d826cc9bba6c6fd31f265a diff --git a/ext/gd/tests/imagesetthickness_basic.phpt b/ext/gd/tests/imagesetthickness_basic.phpt index a8b079bede6fc..205fe7e59e84d 100644 --- a/ext/gd/tests/imagesetthickness_basic.phpt +++ b/ext/gd/tests/imagesetthickness_basic.phpt @@ -24,11 +24,11 @@ imagesetthickness($image, 5); imagerectangle($image, 14, 14, 185, 85, $black); ob_start(); -imagepng($image, null, 9); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -93c3077f1bdc372cd0b0db96db282985 \ No newline at end of file +1a6bc882772310d2e9b32cca2574236c \ No newline at end of file diff --git a/ext/gd/tests/imagestring_basic.phpt b/ext/gd/tests/imagestring_basic.phpt index adc68a67fe4af..f56a2d3226878 100644 --- a/ext/gd/tests/imagestring_basic.phpt +++ b/ext/gd/tests/imagestring_basic.phpt @@ -15,11 +15,11 @@ $white = imagecolorallocate($image, 255,255,255); $result = imagestring($image, 1, 5, 5, 'String Text', $white); ob_start(); -imagepng($image, null, 9); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -d0d2fe757400cb7846b36a8c34b41e4a +7f146e3cdcaf89c6b9d68ccbb44cf94e diff --git a/ext/gd/tests/imagestringup_basic.phpt b/ext/gd/tests/imagestringup_basic.phpt index 0c748b6aa9d7d..144dfc0d8df3e 100644 --- a/ext/gd/tests/imagestringup_basic.phpt +++ b/ext/gd/tests/imagestringup_basic.phpt @@ -15,11 +15,11 @@ $white = imagecolorallocate($image, 255,255,255); $result = imagestringup($image, 1, 5, 25, 'Str', $white); ob_start(); -imagepng($image, null, 9); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); echo md5(base64_encode($img)); ?> --EXPECT-- -7c28016adcf620b772af2a8655b87bd2 +7c55836800702bdd43b4c25d8ebcfcd0 diff --git a/ext/gd/tests/imagetruecolortopalette_basic.phpt b/ext/gd/tests/imagetruecolortopalette_basic.phpt index 3bd0d3102e13d..e7b327475bd09 100644 --- a/ext/gd/tests/imagetruecolortopalette_basic.phpt +++ b/ext/gd/tests/imagetruecolortopalette_basic.phpt @@ -5,6 +5,9 @@ Rafael Dohms --SKIPIF-- --FILE-- @@ -20,7 +23,7 @@ $half2 = imagefilledarc ( $image, 75, 55, 80, 70, 0, -180, $b, IMG_ARC_PIE ); var_dump(imagetruecolortopalette($image, true, 2)); ob_start(); -imagepng($image, null, 9); +imagegd($image); $img = ob_get_contents(); ob_end_clean(); @@ -28,4 +31,4 @@ echo md5(base64_encode($img)); ?> --EXPECT-- bool(true) -1d41787ff70aa0c7eea5ee9304afa36b \ No newline at end of file +17c901cb2217eb7647deed1c79d445de \ No newline at end of file diff --git a/ext/gd/tests/imagetruecolortopalette_error3.phpt b/ext/gd/tests/imagetruecolortopalette_error3.phpt index d65a995014cf3..dbbdb081cc84b 100644 --- a/ext/gd/tests/imagetruecolortopalette_error3.phpt +++ b/ext/gd/tests/imagetruecolortopalette_error3.phpt @@ -25,4 +25,4 @@ Warning: imagetruecolortopalette() expects parameter 3 to be long, resource give Warning: imagetruecolortopalette() expects parameter 3 to be long, array given in %s on line %d -Warning: imagetruecolortopalette(): Number of colors has to be greater than zero in %s on line %d \ No newline at end of file +Warning: imagetruecolortopalette(): Number of colors has to be greater than zero and no more than %d in %s on line %d \ No newline at end of file diff --git a/ext/gd/tests/imagetruecolortopalette_error4.phpt b/ext/gd/tests/imagetruecolortopalette_error4.phpt index b9661e3b852cb..1d56bfcdf0510 100644 --- a/ext/gd/tests/imagetruecolortopalette_error4.phpt +++ b/ext/gd/tests/imagetruecolortopalette_error4.phpt @@ -16,6 +16,6 @@ imagetruecolortopalette($image, true, -1); ?> --EXPECTF-- -Warning: imagetruecolortopalette(): Number of colors has to be greater than zero in %s on line %d +Warning: imagetruecolortopalette(): Number of colors has to be greater than zero and no more than %d in %s on line %d -Warning: imagetruecolortopalette(): Number of colors has to be greater than zero in %s on line %d \ No newline at end of file +Warning: imagetruecolortopalette(): Number of colors has to be greater than zero and no more than %d in %s on line %d \ No newline at end of file diff --git a/ext/gd/tests/libgd00100.phpt b/ext/gd/tests/libgd00100.phpt index abf4ee3339aa7..49716d7107a56 100644 --- a/ext/gd/tests/libgd00100.phpt +++ b/ext/gd/tests/libgd00100.phpt @@ -107,7 +107,7 @@ $points = array( imagefilledpolygon($im, $points, 5, $black); ob_start(); -imagepng($im); +imagegd($im); $png = ob_get_contents(); ob_end_clean(); @@ -116,4 +116,4 @@ echo md5($png); imagedestroy($im); ?> --EXPECTF-- -2e6cf558bb4dadf60c8b608d5f8cda4e +df7253c765280396f303166f10ba9283 diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index e91dbfad0058c..d5d3e2255a1b8 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -3922,7 +3922,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * bt_len++; offset = 0; addr = NULL; - rfc822_parse_adrlist(&addr, tempMailTo, NULL); + rfc822_parse_adrlist(&addr, tempMailTo, "NO HOST"); while (addr) { if (addr->host == NULL || strcmp(addr->host, ERRHOST) == 0) { PHP_IMAP_BAD_DEST; @@ -3951,7 +3951,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * bt_len++; offset = 0; addr = NULL; - rfc822_parse_adrlist(&addr, tempMailTo, NULL); + rfc822_parse_adrlist(&addr, tempMailTo, "NO HOST"); while (addr) { if (addr->host == NULL || strcmp(addr->host, ERRHOST) == 0) { PHP_IMAP_BAD_DEST; @@ -3977,7 +3977,7 @@ int _php_imap_mail(char *to, char *subject, char *message, char *headers, char * bt_len++; offset = 0; addr = NULL; - rfc822_parse_adrlist(&addr, tempMailTo, NULL); + rfc822_parse_adrlist(&addr, tempMailTo, "NO HOST"); while (addr) { if (addr->host == NULL || strcmp(addr->host, ERRHOST) == 0) { PHP_IMAP_BAD_DEST; diff --git a/ext/intl/grapheme/grapheme_util.c b/ext/intl/grapheme/grapheme_util.c index c752b02372e2c..350ba66255894 100644 --- a/ext/intl/grapheme/grapheme_util.c +++ b/ext/intl/grapheme/grapheme_util.c @@ -221,7 +221,7 @@ int grapheme_ascii_check(const unsigned char *day, int32_t len) { int ret_len = len; while ( len-- ) { - if ( *day++ > 0x7f ) + if ( *day++ > 0x7f || (*day == '\n' && *(day - 1) == '\r') ) return -1; } diff --git a/ext/intl/idn/idn.c b/ext/intl/idn/idn.c index 6332488cc9c3d..fb17e3445cf33 100644 --- a/ext/intl/idn/idn.c +++ b/ext/intl/idn/idn.c @@ -158,15 +158,12 @@ static void php_intl_idn_to_46(INTERNAL_FUNCTION_PARAMETERS, len = uidna_nameToUnicodeUTF8(uts46, domain, (int32_t)domain_len, buffer, buffer_capac, &info, &status); } - if (php_intl_idn_check_status(status, "failed to convert name", + if (len >= 255 || php_intl_idn_check_status(status, "failed to convert name", mode TSRMLS_CC) == FAILURE) { uidna_close(uts46); efree(buffer); RETURN_FALSE; } - if (len >= 255) { - php_error_docref(NULL TSRMLS_CC, E_ERROR, "ICU returned an unexpected length"); - } buffer[len] = '\0'; diff --git a/ext/intl/locale/locale_methods.c b/ext/intl/locale/locale_methods.c index 31f60b39a41be..443856ff5e941 100644 --- a/ext/intl/locale/locale_methods.c +++ b/ext/intl/locale/locale_methods.c @@ -1591,6 +1591,24 @@ PHP_FUNCTION(locale_accept_from_http) "locale_accept_from_http: unable to parse input parameters", 0 TSRMLS_CC ); RETURN_FALSE; } + if(http_accept_len > ULOC_FULLNAME_CAPACITY) { + /* check each fragment, if any bigger than capacity, can't do it due to bug #72533 */ + char *start = http_accept; + char *end; + size_t len; + do { + end = strchr(start, ','); + len = end ? end-start : http_accept_len-(start-http_accept); + if(len > ULOC_FULLNAME_CAPACITY) { + intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, + "locale_accept_from_http: locale string too long", 0 TSRMLS_CC ); + RETURN_FALSE; + } + if(end) { + start = end+1; + } + } while(end != NULL); + } available = ures_openAvailableLocales(NULL, &status); INTL_CHECK_STATUS(status, "locale_accept_from_http: failed to retrieve locale list"); diff --git a/ext/intl/msgformat/msgformat_format.c b/ext/intl/msgformat/msgformat_format.c index 55ec9e84ba0e8..25c9619133d6f 100644 --- a/ext/intl/msgformat/msgformat_format.c +++ b/ext/intl/msgformat/msgformat_format.c @@ -51,11 +51,10 @@ static void msgfmt_do_format(MessageFormatter_object *mfo, zval *args, zval *ret zend_hash_destroy(args_copy); efree(args_copy); - if (formatted && U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) { - efree(formatted); - } - if (U_FAILURE(INTL_DATA_ERROR_CODE(mfo))) { + if (formatted) { + efree(formatted); + } RETURN_FALSE; } else { INTL_METHOD_RETVAL_UTF8(mfo, formatted, formatted_len, 1); diff --git a/ext/intl/tests/bug65732.phpt b/ext/intl/tests/bug65732.phpt new file mode 100644 index 0000000000000..b49f884ee4278 --- /dev/null +++ b/ext/intl/tests/bug65732.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #65732 (grapheme_*() is not Unicode compliant on CR LF sequence) +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECT-- +int(1) +string(7) "ef +ghi" +int(2) +==DONE== diff --git a/ext/intl/tests/bug72506.phpt b/ext/intl/tests/bug72506.phpt new file mode 100644 index 0000000000000..a7c561c740f15 --- /dev/null +++ b/ext/intl/tests/bug72506.phpt @@ -0,0 +1,37 @@ +--TEST-- +Bug #72506 (idn_to_ascii with INTL_IDNA_VARIANT_UTS46 fatals for long domain names) +--DESCRIPTION-- +Actually, the $info array should be populated for these cases, but at least it's +not clear yet with which values exactly. +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(false) +array(0) { +} +bool(false) +array(0) { +} +bool(false) +array(0) { +} diff --git a/ext/intl/tests/bug72533.phpt b/ext/intl/tests/bug72533.phpt new file mode 100644 index 0000000000000..c7fcba39d029b --- /dev/null +++ b/ext/intl/tests/bug72533.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #72533 (locale_accept_from_http out-of-bounds access) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +false +'locale_accept_from_http: locale string too long: U_ILLEGAL_ARGUMENT_ERROR' +'en' \ No newline at end of file diff --git a/ext/intl/tests/calendar_createInstance_basic.phpt b/ext/intl/tests/calendar_createInstance_basic.phpt index e062030fece90..426cc8b60fe78 100644 --- a/ext/intl/tests/calendar_createInstance_basic.phpt +++ b/ext/intl/tests/calendar_createInstance_basic.phpt @@ -23,7 +23,7 @@ echo "\n"; $timeMillis = $cal->getTime(); $time = time(); -var_dump(abs($timeMillis - $time * 1000) < 1000); +var_dump(abs($timeMillis - $time * 1000) < 2000); ?> ==DONE== diff --git a/ext/intl/tests/calendar_getNow_basic.phpt b/ext/intl/tests/calendar_getNow_basic.phpt index 18325dfa605d9..2df112d7b2302 100644 --- a/ext/intl/tests/calendar_getNow_basic.phpt +++ b/ext/intl/tests/calendar_getNow_basic.phpt @@ -13,11 +13,11 @@ $now = IntlCalendar::getNow(); $proc_now = intlcal_get_now(); $time = time(); var_dump(abs($now - $proc_now) < 500); -var_dump(abs($time * 1000 - $proc_now) < 1000); +var_dump(abs($time * 1000 - $proc_now) < 2000); ?> ==DONE== --EXPECT-- bool(true) bool(true) -==DONE== \ No newline at end of file +==DONE== diff --git a/ext/json/json.c b/ext/json/json.c index 634d6e55f5a40..8c4d20fb2abf0 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -704,6 +704,12 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, RETURN_NULL(); } + if (depth > INT_MAX) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be lower than %d", INT_MAX); + efree(utf16); + RETURN_NULL(); + } + ALLOC_INIT_ZVAL(z); jp = new_JSON_parser(depth); if (parse_JSON_ex(jp, z, utf16, utf16_len, options TSRMLS_CC)) { diff --git a/ext/json/tests/bug72787.phpt b/ext/json/tests/bug72787.phpt new file mode 100644 index 0000000000000..c9820faa9fa2b --- /dev/null +++ b/ext/json/tests/bug72787.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #72787 (json_decode reads out of bounds) +--SKIPIF-- + + +--FILE-- + +--EXPECTF-- + +Warning: json_decode(): Depth must be lower than %d in %s on line %d +NULL diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 5ffc17b96f6ab..e709e592fa11d 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -367,6 +367,7 @@ PHP_FUNCTION(ldap_connect) int urllen = hostlen + sizeof( "ldap://:65535" ); if (port <= 0 || port > 65535) { + efree(ld); php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid port number: %ld", port); RETURN_FALSE; } diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index bd0016b79ffb0..b252cb6d8170a 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -1272,8 +1272,8 @@ PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object T efree(object->document->doc_props); } efree(object->document); - object->document = NULL; } + object->document = NULL; } return ret_refcount; diff --git a/ext/libxml/php_libxml2.def b/ext/libxml/php_libxml2.def index 42a939ebb8d90..905dbf386be11 100644 --- a/ext/libxml/php_libxml2.def +++ b/ext/libxml/php_libxml2.def @@ -1544,3 +1544,5 @@ xmlXPtrNewRangePointNode xmlXPtrNewRangePoints xmlXPtrRangeToFunction xmlXPtrWrapLocationSet +xmlBufContent +xmlBufUse diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 1cfaf2cc36efa..ee8a00912b348 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -2799,6 +2799,13 @@ PHP_FUNCTION(mb_substr) RETURN_FALSE; } + if (from > INT_MAX) { + from = INT_MAX; + } + if (len > INT_MAX) { + len = INT_MAX; + } + ret = mbfl_substr(&string, &result, from, len); if (NULL == ret) { RETURN_FALSE; diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 67951a828e37f..7e9756fa158cc 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -456,7 +456,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl found = zend_hash_find(&MBREX(ht_rc), (char *)pattern, patlen+1, (void **) &rc); if (found == FAILURE || (*rc)->options != options || (*rc)->enc != enc || (*rc)->syntax != syntax) { if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) { - onig_error_code_to_str(err_str, err_code, err_info); + onig_error_code_to_str(err_str, err_code, &err_info); php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex compile err: %s", err_str); retval = NULL; goto out; @@ -1235,9 +1235,6 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode) php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbregex_search(): %s", err_str); RETVAL_FALSE; } else { - if (MBREX(search_regs)->beg[0] == MBREX(search_regs)->end[0]) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression"); - } switch (mode) { case 1: array_init(return_value); @@ -1264,7 +1261,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode) break; } end = MBREX(search_regs)->end[0]; - if (pos < end) { + if (pos <= end) { MBREX(search_pos) = end; } else { MBREX(search_pos) = pos + 1; @@ -1403,7 +1400,7 @@ PHP_FUNCTION(mb_ereg_search_setpos) return; } - if (position < 0 || (MBREX(search_str) != NULL && Z_TYPE_P(MBREX(search_str)) == IS_STRING && position >= Z_STRLEN_P(MBREX(search_str)))) { + if (position < 0 || (MBREX(search_str) != NULL && Z_TYPE_P(MBREX(search_str)) == IS_STRING && position > Z_STRLEN_P(MBREX(search_str)))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Position is out of range"); MBREX(search_pos) = 0; RETURN_FALSE; diff --git a/ext/mbstring/tests/bug66797.phpt b/ext/mbstring/tests/bug66797.phpt new file mode 100644 index 0000000000000..df9e789be6c8c --- /dev/null +++ b/ext/mbstring/tests/bug66797.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #66797 (mb_substr only takes 32-bit signed integer) +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECTF-- +string(3) "bar" +string(3) "bar" +string(0) "" +string(0) "" +==DONE== diff --git a/ext/mbstring/tests/bug72691.phpt b/ext/mbstring/tests/bug72691.phpt new file mode 100644 index 0000000000000..08f6b153da743 --- /dev/null +++ b/ext/mbstring/tests/bug72691.phpt @@ -0,0 +1,48 @@ +--TEST-- +Bug #72691 (mb_ereg_search raises a warning if a match zero-width) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +int(0) +array(1) { + [0]=> + string(0) "" +} +int(0) +array(1) { + [0]=> + string(0) "" +} +int(3) +array(1) { + [0]=> + string(3) "foo" +} +int(3) +array(1) { + [0]=> + string(0) "" +} diff --git a/ext/mbstring/tests/bug72693.phpt b/ext/mbstring/tests/bug72693.phpt new file mode 100644 index 0000000000000..f269e57f0f172 --- /dev/null +++ b/ext/mbstring/tests/bug72693.phpt @@ -0,0 +1,41 @@ +--TEST-- +Bug #72693 (mb_ereg_search increments search position when a match zero-width) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) +int(0) +bool(true) +int(0) +bool(true) +int(3) +array(1) { + [0]=> + string(3) "foo" +} +bool(true) +int(3) +bool(true) +int(3) diff --git a/ext/mbstring/tests/bug72694.phpt b/ext/mbstring/tests/bug72694.phpt new file mode 100644 index 0000000000000..90f56a397af93 --- /dev/null +++ b/ext/mbstring/tests/bug72694.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #72694 (mb_ereg_search_setpos does not accept a string's last position) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) +int(3) +bool(true) +int(3) diff --git a/ext/mbstring/tests/bug72710.phpt b/ext/mbstring/tests/bug72710.phpt new file mode 100644 index 0000000000000..19becc50102f8 --- /dev/null +++ b/ext/mbstring/tests/bug72710.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #72710 (`mb_ereg` causes buffer overflow on regexp compile error) +--SKIPIF-- + +--FILE-- +a)', 'a'); +?> +--EXPECTF-- +Warning: mb_ereg(): mbregex compile err: invalid group name <0> in %s on line %d diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index aa1ea5460400d..66497f1f51ddf 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -2235,21 +2235,24 @@ PHP_FUNCTION(mssql_guid_string) char *binary; int binary_len; zend_bool sf = 0; - char buffer[32+1]; - char buffer2[36+1]; + char buffer[32+1] = { 0 }; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &binary, &binary_len, &sf) == FAILURE) { return; } - dbconvert(NULL, SQLBINARY, (BYTE*) binary, MIN(16, binary_len), SQLCHAR, buffer, -1); + if (dbconvert(NULL, SQLBINARY, (BYTE*) binary, MIN(16, binary_len), SQLCHAR, buffer, (DBINT) -1) == -1) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not convert binary string to GUID string"); + RETURN_FALSE; + } if (sf) { php_strtoupper(buffer, 32); RETURN_STRING(buffer, 1); - } - else { + } else { int i; + char buffer2[36+1] = { 0 }; + /* FIXME this works only on little endian machine */ for (i=0; i<4; i++) { buffer2[2*i] = buffer[6-2*i]; diff --git a/ext/oci8/README b/ext/oci8/README index 42833e27c050b..5d1743dfce5b2 100644 --- a/ext/oci8/README +++ b/ext/oci8/README @@ -5,15 +5,13 @@ Use the OCI8 extension to access Oracle Database. Documentation is at http://php.net/oci8 -PHP OCI8 2.1 builds with PHP 7. +Use 'pecl install oci8' to install for PHP 7. -Use 'pecl install oci8' to install OCI8 for PHP 7. +Use 'pecl install oci8-2.0.12' to install for PHP 5.2 - PHP 5.6. -Use 'pecl install oci8-2.0.10' to install OCI8 for PHP 5.2 - PHP 5.6. +Use 'pecl install oci8-1.4.10' to install for PHP 4.3.9 - PHP 5.1. -Use 'pecl install oci8-1.4.10' to install OCI8 for PHP 4.3.9 - PHP 5.1. - -The OCI8 extension needs to be linked with Oracle 12.1, 11, or 10.2 +The OCI8 extension needs to be linked with Oracle 12, 11, or 10.2 client libraries. These libraries are found in your database installation, or in the free Oracle Instant Client from http://www.oracle.com/technetwork/database/features/instant-client/ diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 8effa3c719ada..020312b6429eb 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -2692,7 +2692,8 @@ void php_oci_fetch_row (INTERNAL_FUNCTION_PARAMETERS, int mode, int expected_arg #else /* OCI_MAJOR_VERSION */ PHP_OCI_ZVAL_TO_STATEMENT(z_statement, invokedstatement); - if (invokedstatement->impres_flag == PHP_OCI_IMPRES_NO_CHILDREN) { + if (invokedstatement->impres_flag == PHP_OCI_IMPRES_NO_CHILDREN || + invokedstatement->impres_flag == PHP_OCI_IMPRES_IS_CHILD) { /* Already know there are no Implicit Result Sets */ statement = invokedstatement; } else if (invokedstatement->impres_flag == PHP_OCI_IMPRES_HAS_CHILDREN) { diff --git a/ext/oci8/package.xml b/ext/oci8/package.xml index 2f93fc48301b3..d83df79802e56 100644 --- a/ext/oci8/package.xml +++ b/ext/oci8/package.xml @@ -8,10 +8,10 @@ http://pear.php.net/dtd/package-2.0.xsd"> Extension for Oracle Database -Use the OCI8 extension to access Oracle Database. PHP OCI8 2.1 builds -with PHP 7. Use 'pecl install oci8-2.0.11' to install OCI8 for PHP -5.2 - PHP 5.6. Use 'pecl install oci8-1.4.10' to install PHP OCI8 1.4 -for PHP 4.3.9 - PHP 5.1. The OCI8 extension can be linked with Oracle +Use the OCI8 extension to access Oracle Database. Use 'pecl install +oci8' to install for PHP 7. Use 'pecl install oci8-2.0.12' to install +for PHP 5.2 - PHP 5.6. Use 'pecl install oci8-1.4.10' to install for +PHP 4.3.9 - PHP 5.1. The OCI8 extension can be linked with Oracle client libraries from Oracle Database 12.1, 11, or 10.2. These libraries are found in your database installation, or in the free Oracle Instant Client from @@ -46,12 +46,12 @@ Interoperability Support" (ID 207303.1) for details. no - 2016-04-15 + 2016-08-18 - 2.0.11 - 2.0.11 + 2.0.12 + 2.0.12 stable @@ -59,7 +59,7 @@ Interoperability Support" (ID 207303.1) for details. PHP -Fixed bug #71422 (Fix ORA-01438: value larger than specified precision allowed for this column) +Fixed invalid handle error with Implicit Result Sets @@ -465,6 +465,21 @@ Fixed bug #71422 (Fix ORA-01438: value larger than specified precision allowed f + + + 2.0.11 + 2.0.11 + + + stable + stable + + PHP + +Fixed bug #71422 (Fix ORA-01438: value larger than specified precision allowed for this column) + + + 2.0.10 diff --git a/ext/oci8/php_oci8.h b/ext/oci8/php_oci8.h index ae28aec6c4321..5539edfa42fa0 100644 --- a/ext/oci8/php_oci8.h +++ b/ext/oci8/php_oci8.h @@ -45,7 +45,7 @@ */ #undef PHP_OCI8_VERSION #endif -#define PHP_OCI8_VERSION "2.0.11" +#define PHP_OCI8_VERSION "2.0.12" extern zend_module_entry oci8_module_entry; #define phpext_oci8_ptr &oci8_module_entry diff --git a/ext/oci8/tests/array_bind_003.phpt b/ext/oci8/tests/array_bind_003.phpt index eee1500202fec..bd391db93f13e 100644 --- a/ext/oci8/tests/array_bind_003.phpt +++ b/ext/oci8/tests/array_bind_003.phpt @@ -63,7 +63,7 @@ echo "Done\n"; ?> --EXPECTF-- Warning: oci_execute(): ORA-01403: %s -ORA-06512: at "SYSTEM.ARRAY_BIND_003_PKG", line %d +ORA-06512: at "%s.ARRAY_BIND_003_PKG", line %d ORA-06512: at line %d in %sarray_bind_003.php on line %d array(4) { [0]=> diff --git a/ext/oci8/tests/array_bind_004.phpt b/ext/oci8/tests/array_bind_004.phpt index a998a2225bdfa..7373903b6fbdd 100644 --- a/ext/oci8/tests/array_bind_004.phpt +++ b/ext/oci8/tests/array_bind_004.phpt @@ -63,7 +63,7 @@ echo "Done\n"; ?> --EXPECTF-- Warning: oci_execute(): ORA-01403: %s -ORA-06512: at "SYSTEM.ARRAY_BIND_004_PKG", line %d +ORA-06512: at "%s.ARRAY_BIND_004_PKG", line %d ORA-06512: at line %d in %sarray_bind_004.php on line %d array(0) { } diff --git a/ext/oci8/tests/imp_res_call_error.phpt b/ext/oci8/tests/imp_res_call_error.phpt index 8b0fa78db91a9..bae2c47e9ef8b 100644 --- a/ext/oci8/tests/imp_res_call_error.phpt +++ b/ext/oci8/tests/imp_res_call_error.phpt @@ -57,5 +57,5 @@ Test 1 Warning: oci_execute(): ORA-29478: %s ORA-06512: at "SYS.DBMS_SQL", line %d ORA-06512: at "SYS.DBMS_SQL", line %d -ORA-06512: at "SYSTEM.IMP_RES_CALL_ERR_PROC", line %d in %simp_res_call_error.php on line %d +ORA-06512: at "%s.IMP_RES_CALL_ERR_PROC", line %d in %simp_res_call_error.php on line %d ===DONE=== diff --git a/ext/oci8/tests/refcur_prefetch_4.phpt b/ext/oci8/tests/refcur_prefetch_4.phpt index f0c7183d0e9da..131ae6ad6b029 100644 --- a/ext/oci8/tests/refcur_prefetch_4.phpt +++ b/ext/oci8/tests/refcur_prefetch_4.phpt @@ -157,7 +157,7 @@ echo "Done\n"; ------Test 1 - Set Prefetch after PL/SQL fetch ---------- Warning: oci_execute(): ORA-01001: %s -ORA-06512: at "SYSTEM.REFCURPKG", line %d +ORA-06512: at "%s.REFCURPKG", line %d ORA-06512: at line %d in %s on line %d Fetch Row from PL/SQL int(0) diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 6b258b9a209d6..ddc5d764f93a1 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -215,7 +215,7 @@ static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_D } while (ni++ < name_cnt) { - name_idx = 0xff * (unsigned char)name_table[0] + (unsigned char)name_table[1]; + name_idx = 0x100 * (unsigned char)name_table[0] + (unsigned char)name_table[1]; subpat_names[name_idx] = name_table + 2; if (is_numeric_string(subpat_names[name_idx], strlen(subpat_names[name_idx]), NULL, NULL, 0) > 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Numeric named subpatterns are not allowed"); diff --git a/ext/pcre/tests/bug72688.phpt b/ext/pcre/tests/bug72688.phpt new file mode 100644 index 0000000000000..715743c73dbf5 --- /dev/null +++ b/ext/pcre/tests/bug72688.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #72688 (preg_match missing group names in matches) +--FILE-- + +--EXPECT-- +string(3) "290" diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index a2ae2fdf3a39e..f5c295c26c377 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2623,7 +2623,15 @@ static int row_prop_exists(zval *object, zval *member, int check_empty, const ze * numbers */ for (colno = 0; colno < stmt->column_count; colno++) { if (strcmp(stmt->columns[colno].name, Z_STRVAL_P(member)) == 0) { - return 1; + int res; + zval *val; + + MAKE_STD_ZVAL(val); + fetch_value(stmt, val, colno, NULL TSRMLS_CC); + res = check_empty ? i_zend_is_true(val) : Z_TYPE_P(val) != IS_NULL; + zval_ptr_dtor(&val); + + return res; } } } diff --git a/ext/pdo/tests/bug_60665.phpt b/ext/pdo/tests/bug_60665.phpt new file mode 100644 index 0000000000000..28c14821546f9 --- /dev/null +++ b/ext/pdo/tests/bug_60665.phpt @@ -0,0 +1,41 @@ +--TEST-- +PDO Common: Bug #60665 (call to empty() on NULL result using PDO::FETCH_LAZY returns false) +--SKIPIF-- + +--FILE-- +prepare("SELECT NULL AS null_value, 0 AS zero, 1 AS one"); +$statement->execute(); +$row = $statement->fetch(PDO::FETCH_LAZY); +var_dump( + empty($row->null_value), + empty($row->zero), + !empty($row->one), + empty($row->missing), + !isset($row->null_value), + isset($row->zero), + isset($row->one), + !isset($row->missing) +); +?> +===DONE=== +--EXPECT-- +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) +===DONE=== diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 8467552596c9f..af4e6d7e600d4 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -44,6 +44,8 @@ #include "php_pdo_pgsql_int.h" #include "zend_exceptions.h" +static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC); + static char * _pdo_pgsql_trim_message(const char *message, int persistent) { register int i = strlen(message)-1; @@ -358,31 +360,45 @@ static char *pdo_pgsql_last_insert_id(pdo_dbh_t *dbh, const char *name, unsigned { pdo_pgsql_db_handle *H = (pdo_pgsql_db_handle *)dbh->driver_data; char *id = NULL; + PGresult *res; + ExecStatusType status; + zend_bool savepoint = 0; if (name == NULL) { - if (H->pgoid == InvalidOid) { - return NULL; + savepoint = pgsql_handle_in_transaction(dbh TSRMLS_CC); + + if (savepoint) { + /* The savepoint is overwritten every time. */ + (void)PQexec(H->server, "SAVEPOINT _php_lastid_savepoint"); } - *len = spprintf(&id, 0, "%ld", (long) H->pgoid); + res = PQexec(H->server, "SELECT LASTVAL()"); } else { - PGresult *res; - ExecStatusType status; const char *q[1]; q[0] = name; + res = PQexecParams(H->server, "SELECT CURRVAL($1)", 1, NULL, q, NULL, NULL, 0); - status = PQresultStatus(res); + } + status = PQresultStatus(res); - if (res && (status == PGRES_TUPLES_OK)) { - id = estrdup((char *)PQgetvalue(res, 0, 0)); - *len = PQgetlength(res, 0, 0); - } else { - pdo_pgsql_error(dbh, status, pdo_pgsql_sqlstate(res)); + if (res && (status == PGRES_TUPLES_OK)) { + id = estrdup((char *)PQgetvalue(res, 0, 0)); + *len = PQgetlength(res, 0, 0); + } else { + if (savepoint) { + (void)PQexec(H->server, "ROLLBACK TO SAVEPOINT _php_lastid_savepoint"); } + pdo_pgsql_error(dbh, status, pdo_pgsql_sqlstate(res)); + *len = spprintf(&id, 0, "%ld", (long) H->pgoid); + } - if (res) { - PQclear(res); - } + if (savepoint) { + (void)PQexec(H->server, "RELEASE SAVEPOINT _php_lastid_savepoint"); } + + if (res) { + PQclear(res); + } + return id; } diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c index ff34e48579403..a6e6405a1c510 100644 --- a/ext/pdo_pgsql/pgsql_statement.c +++ b/ext/pdo_pgsql/pgsql_statement.c @@ -280,7 +280,7 @@ static int pgsql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data * case PDO_PARAM_EVT_EXEC_PRE: if (!stmt->bound_param_map) { - return 0; + return 1; } if (!S->param_values) { S->param_values = ecalloc( diff --git a/ext/pdo_pgsql/tests/bug70313.phpt b/ext/pdo_pgsql/tests/bug70313.phpt new file mode 100644 index 0000000000000..14c3b7bfcc6da --- /dev/null +++ b/ext/pdo_pgsql/tests/bug70313.phpt @@ -0,0 +1,37 @@ +--TEST-- +PDO PgSQL Bug #70313 (PDO statement fails to throw exception) +--SKIPIF-- + +--FILE-- +setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); + +$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); +try { + $stmt = $db->prepare(");"); + + $stmt->execute([1]); +} catch (PDOException $e) { + var_dump($e->getCode()); +} + +$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); +try { + $stmt = $db->prepare(");"); + + $stmt->execute([1]); +} catch (PDOException $e) { + var_dump($e->getCode()); +} + +?> +--EXPECT-- +string(5) "42601" +string(5) "42601" diff --git a/ext/pdo_pgsql/tests/bug72633.phpt b/ext/pdo_pgsql/tests/bug72633.phpt new file mode 100644 index 0000000000000..06bd25e6268aa --- /dev/null +++ b/ext/pdo_pgsql/tests/bug72633.phpt @@ -0,0 +1,39 @@ +--TEST-- +PDO PgSQL Bug #72633 (Postgres PDO lastInsertId() should work without specifying a sequence) +--SKIPIF-- + +--FILE-- +setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false); + +$db->query('CREATE TABLE test_last_id (id SERIAL NOT NULL, field1 VARCHAR(10))'); + +$stmt = $db->prepare("INSERT INTO test_last_id (field1) VALUES ('test')"); + +$stmt->execute(); + +/** + * No sequence name informed + */ +var_dump($db->lastInsertId()); +/** + * Sequence name informed + */ +var_dump($db->lastInsertId('test_last_id_id_seq')); + +$db->query('DROP TABLE test_last_id'); + +?> +--EXPECTREGEX-- +string\([0-9]*\)\ \"[0-9]*\" +string\([0-9]*\)\ \"[0-9]*\" diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index fbcf7a77ca8e3..5f15287237d5f 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -673,21 +673,26 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in static void _const_string(string *str, char *name, zval *value, char *indent TSRMLS_DC) { char *type; - zval value_copy; - int use_copy; - type = zend_zval_type_name(value); - zend_make_printable_zval(value, &value_copy, &use_copy); - if (use_copy) { - value = &value_copy; - } + if (Z_TYPE_P(value) == IS_ARRAY) { + string_printf(str, "%s Constant [ %s %s ] { Array }\n", + indent, type, name); + } else { + zval value_copy; + int use_copy; - string_printf(str, "%s Constant [ %s %s ] { %s }\n", - indent, type, name, Z_STRVAL_P(value)); + zend_make_printable_zval(value, &value_copy, &use_copy); + if (use_copy) { + value = &value_copy; + } + + string_printf(str, "%s Constant [ %s %s ] { %s }\n", + indent, type, name, Z_STRVAL_P(value)); - if (use_copy) { - zval_dtor(value); + if (use_copy) { + zval_dtor(value); + } } } /* }}} */ diff --git a/ext/reflection/tests/ReflectionClass_export_array_bug72222.phpt b/ext/reflection/tests/ReflectionClass_export_array_bug72222.phpt new file mode 100644 index 0000000000000..e64dc97109738 --- /dev/null +++ b/ext/reflection/tests/ReflectionClass_export_array_bug72222.phpt @@ -0,0 +1,31 @@ +--TEST-- +ReflectionClass::export() - array constants +--FILE-- + +--EXPECTF-- +Class [ class A ] { + @@ %s 2-5 + + - Constants [2] { + Constant [ integer A ] { 8 } + Constant [ array B ] { Array } + } + + - Static properties [0] { + } + + - Static methods [0] { + } + + - Properties [0] { + } + + - Methods [0] { + } +} diff --git a/ext/session/session.c b/ext/session/session.c index b4e5a327c16fb..b2d02361dfd13 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -867,7 +867,7 @@ PS_SERIALIZER_DECODE_FUNC(php_serialize) /* {{{ */ if (php_var_unserialize(&session_vars, &val, endptr, &var_hash TSRMLS_CC)) { var_push_dtor(&var_hash, &session_vars); } - + PHP_VAR_UNSERIALIZE_DESTROY(var_hash); if (PS(http_session_vars)) { zval_ptr_dtor(&PS(http_session_vars)); @@ -924,14 +924,17 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */ int namelen; int has_value; php_unserialize_data_t var_hash; + int skip = 0; PHP_VAR_UNSERIALIZE_INIT(var_hash); for (p = val; p < endptr; ) { zval **tmp; + skip = 0; namelen = ((unsigned char)(*p)) & (~PS_BIN_UNDEF); if (namelen < 0 || namelen > PS_BIN_MAX || (p + namelen) >= endptr) { + PHP_VAR_UNSERIALIZE_DESTROY(var_hash); return FAILURE; } @@ -943,22 +946,25 @@ PS_SERIALIZER_DECODE_FUNC(php_binary) /* {{{ */ if (zend_hash_find(&EG(symbol_table), name, namelen + 1, (void **) &tmp) == SUCCESS) { if ((Z_TYPE_PP(tmp) == IS_ARRAY && Z_ARRVAL_PP(tmp) == &EG(symbol_table)) || *tmp == PS(http_session_vars)) { - efree(name); - continue; + skip = 1; } } if (has_value) { ALLOC_INIT_ZVAL(current); if (php_var_unserialize(¤t, (const unsigned char **) &p, (const unsigned char *) endptr, &var_hash TSRMLS_CC)) { - php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC); + if (!skip) { + php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC); + } } else { PHP_VAR_UNSERIALIZE_DESTROY(var_hash); return FAILURE; } var_push_dtor_no_addref(&var_hash, ¤t); } - PS_ADD_VARL(name, namelen); + if (!skip) { + PS_ADD_VARL(name, namelen); + } efree(name); } @@ -1015,6 +1021,7 @@ PS_SERIALIZER_DECODE_FUNC(php) /* {{{ */ int namelen; int has_value; php_unserialize_data_t var_hash; + int skip = 0; PHP_VAR_UNSERIALIZE_INIT(var_hash); @@ -1023,6 +1030,7 @@ PS_SERIALIZER_DECODE_FUNC(php) /* {{{ */ while (p < endptr) { zval **tmp; q = p; + skip = 0; while (*q != PS_DELIMITER) { if (++q >= endptr) goto break_outer_loop; } @@ -1039,14 +1047,16 @@ PS_SERIALIZER_DECODE_FUNC(php) /* {{{ */ if (zend_hash_find(&EG(symbol_table), name, namelen + 1, (void **) &tmp) == SUCCESS) { if ((Z_TYPE_PP(tmp) == IS_ARRAY && Z_ARRVAL_PP(tmp) == &EG(symbol_table)) || *tmp == PS(http_session_vars)) { - goto skip; + skip = 1; } } if (has_value) { ALLOC_INIT_ZVAL(current); if (php_var_unserialize(¤t, (const unsigned char **) &q, (const unsigned char *) endptr, &var_hash TSRMLS_CC)) { - php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC); + if (!skip) { + php_set_session_var(name, namelen, current, &var_hash TSRMLS_CC); + } } else { var_push_dtor_no_addref(&var_hash, ¤t); efree(name); @@ -1055,7 +1065,9 @@ PS_SERIALIZER_DECODE_FUNC(php) /* {{{ */ } var_push_dtor_no_addref(&var_hash, ¤t); } - PS_ADD_VARL(name, namelen); + if (!skip) { + PS_ADD_VARL(name, namelen); + } skip: efree(name); diff --git a/ext/session/tests/bug72562.phpt b/ext/session/tests/bug72562.phpt new file mode 100644 index 0000000000000..b36cf6df255d7 --- /dev/null +++ b/ext/session/tests/bug72562.phpt @@ -0,0 +1,44 @@ +--TEST-- +Bug #72562: Use After Free in unserialize() with Unexpected Session Deserialization +--SKIPIF-- + +--FILE-- +>= 8; + } + return $out; +} +?> +--EXPECTF-- +Warning: session_decode(): Failed to decode session object. Session has been destroyed in %s%ebug72562.php on line %d + +Notice: unserialize(): Error at offset 0 of 1 bytes in %s%ebug72562.php on line %d + +Notice: unserialize(): Error at offset 4 of 4 bytes in %s%ebug72562.php on line %d +bool(false) diff --git a/ext/session/tests/bug72681.phpt b/ext/session/tests/bug72681.phpt new file mode 100644 index 0000000000000..ca38b07fc909e --- /dev/null +++ b/ext/session/tests/bug72681.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #72681: PHP Session Data Injection Vulnerability +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(0) { +} diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index d5e21f911c65d..d2c1b94bb8963 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -473,7 +473,7 @@ static void php_snmp_session_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC) static void php_snmp_object_free_storage(void *object TSRMLS_DC) { php_snmp_object *intern = (php_snmp_object *)object; - + if (!intern) { return; } @@ -481,7 +481,7 @@ static void php_snmp_object_free_storage(void *object TSRMLS_DC) netsnmp_session_free(&(intern->session)); zend_object_std_dtor(&intern->zo TSRMLS_CC); - + efree(intern); } @@ -501,7 +501,7 @@ static zend_object_value php_snmp_object_new(zend_class_entry *class_type TSRMLS retval.handlers = (zend_object_handlers *) &php_snmp_object_handlers; return retval; - + } /* {{{ php_snmp_error @@ -554,7 +554,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D char *dbuf = (char *)NULL; int buflen = sizeof(sbuf) - 1; int val_len = vars->val_len; - + /* use emalloc() for large values, use static array otherwize */ /* There is no way to know the size of buffer snprint_value() needs in order to print a value there. @@ -700,7 +700,7 @@ static void php_snmp_getvalue(struct variable_list *vars, zval *snmpval TSRMLS_D * SNMP object fetcher/setter for all SNMP versions * */ -static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, +static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, struct snmp_session *session, struct objid_query *objid_query) { @@ -719,7 +719,7 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, /* we start with retval=FALSE. If any actual data is acquired, retval will be set to appropriate type */ RETVAL_FALSE; - + /* reset errno and errstr */ php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_NOERROR, ""); @@ -803,8 +803,8 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, } for (vars = response->variables; vars; vars = vars->next_variable) { /* do not output errors as values */ - if ( vars->type == SNMP_ENDOFMIBVIEW || - vars->type == SNMP_NOSUCHOBJECT || + if ( vars->type == SNMP_ENDOFMIBVIEW || + vars->type == SNMP_NOSUCHOBJECT || vars->type == SNMP_NOSUCHINSTANCE ) { if ((st & SNMP_CMD_WALK) && Z_TYPE_P(return_value) == IS_ARRAY) { break; @@ -814,8 +814,8 @@ static void php_snmp_internal(INTERNAL_FUNCTION_PARAMETERS, int st, php_snmp_error(getThis(), NULL TSRMLS_CC, PHP_SNMP_ERRNO_ERROR_IN_REPLY, "Error in packet at '%s': %s", buf, buf2); continue; } - - if ((st & SNMP_CMD_WALK) && + + if ((st & SNMP_CMD_WALK) && (vars->name_length < rootlen || memcmp(root, vars->name, rootlen * sizeof(oid)))) { /* not part of this subtree */ if (Z_TYPE_P(return_value) == IS_ARRAY) { /* some records are fetched already, shut down further lookup */ keepwalking = 0; @@ -1032,7 +1032,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu php_error_docref(NULL TSRMLS_CC, E_WARNING, "Got empty OID array"); return FALSE; } - objid_query->vars = (snmpobjarg *)emalloc(sizeof(snmpobjarg) * zend_hash_num_elements(Z_ARRVAL_PP(oid))); + objid_query->vars = (snmpobjarg *)safe_emalloc(sizeof(snmpobjarg), zend_hash_num_elements(Z_ARRVAL_PP(oid)), 0); if (objid_query->vars == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "emalloc() failed while parsing oid array: %s", strerror(errno)); efree(objid_query->vars); @@ -1099,7 +1099,7 @@ static int php_snmp_parse_oid(zval *object, int st, struct objid_query *objid_qu efree(objid_query->vars); return FALSE; } - } else { + } else { memmove((char *)objid_query->vars[0].name, (char *)objid_mib, sizeof(objid_mib)); objid_query->vars[0].name_length = sizeof(objid_mib) / sizeof(oid); } @@ -1435,7 +1435,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) int session_less_mode = (getThis() == NULL); php_snmp_object *snmp_object; php_snmp_object glob_snmp_object; - + objid_query.max_repetitions = -1; objid_query.non_repeaters = 0; objid_query.valueretrieval = SNMP_G(valueretrieval); @@ -1548,7 +1548,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) } php_snmp_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU, st, session, &objid_query); - + efree(objid_query.vars); if (session_less_mode) { @@ -1561,7 +1561,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) } /* }}} */ -/* {{{ proto mixed snmpget(string host, string community, mixed object_id [, int timeout [, int retries]]) +/* {{{ proto mixed snmpget(string host, string community, mixed object_id [, int timeout [, int retries]]) Fetch a SNMP object */ PHP_FUNCTION(snmpget) { @@ -1569,7 +1569,7 @@ PHP_FUNCTION(snmpget) } /* }}} */ -/* {{{ proto mixed snmpgetnext(string host, string community, mixed object_id [, int timeout [, int retries]]) +/* {{{ proto mixed snmpgetnext(string host, string community, mixed object_id [, int timeout [, int retries]]) Fetch a SNMP object */ PHP_FUNCTION(snmpgetnext) { @@ -1577,7 +1577,7 @@ PHP_FUNCTION(snmpgetnext) } /* }}} */ -/* {{{ proto mixed snmpwalk(string host, string community, mixed object_id [, int timeout [, int retries]]) +/* {{{ proto mixed snmpwalk(string host, string community, mixed object_id [, int timeout [, int retries]]) Return all objects under the specified object id */ PHP_FUNCTION(snmpwalk) { @@ -1593,7 +1593,7 @@ PHP_FUNCTION(snmprealwalk) } /* }}} */ -/* {{{ proto bool snmpset(string host, string community, mixed object_id, mixed type, mixed value [, int timeout [, int retries]]) +/* {{{ proto bool snmpset(string host, string community, mixed object_id, mixed type, mixed value [, int timeout [, int retries]]) Set the value of a SNMP object */ PHP_FUNCTION(snmpset) { @@ -1640,7 +1640,7 @@ PHP_FUNCTION(snmp_set_enum_print) netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_NUMERIC_ENUM, (int) a1); RETURN_TRUE; -} +} /* }}} */ /* {{{ proto bool snmp_set_oid_output_format(int oid_format) @@ -1668,10 +1668,10 @@ PHP_FUNCTION(snmp_set_oid_output_format) RETURN_FALSE; break; } -} +} /* }}} */ -/* {{{ proto mixed snmp2_get(string host, string community, mixed object_id [, int timeout [, int retries]]) +/* {{{ proto mixed snmp2_get(string host, string community, mixed object_id [, int timeout [, int retries]]) Fetch a SNMP object */ PHP_FUNCTION(snmp2_get) { @@ -1679,7 +1679,7 @@ PHP_FUNCTION(snmp2_get) } /* }}} */ -/* {{{ proto mixed snmp2_getnext(string host, string community, mixed object_id [, int timeout [, int retries]]) +/* {{{ proto mixed snmp2_getnext(string host, string community, mixed object_id [, int timeout [, int retries]]) Fetch a SNMP object */ PHP_FUNCTION(snmp2_getnext) { @@ -1687,7 +1687,7 @@ PHP_FUNCTION(snmp2_getnext) } /* }}} */ -/* {{{ proto mixed snmp2_walk(string host, string community, mixed object_id [, int timeout [, int retries]]) +/* {{{ proto mixed snmp2_walk(string host, string community, mixed object_id [, int timeout [, int retries]]) Return all objects under the specified object id */ PHP_FUNCTION(snmp2_walk) { @@ -1703,7 +1703,7 @@ PHP_FUNCTION(snmp2_real_walk) } /* }}} */ -/* {{{ proto bool snmp2_set(string host, string community, mixed object_id, mixed type, mixed value [, int timeout [, int retries]]) +/* {{{ proto bool snmp2_set(string host, string community, mixed object_id, mixed type, mixed value [, int timeout [, int retries]]) Set the value of a SNMP object */ PHP_FUNCTION(snmp2_set) { @@ -1819,7 +1819,7 @@ PHP_METHOD(snmp, __construct) snmp_object = (php_snmp_object *)zend_object_store_get_object(object TSRMLS_CC); zend_replace_error_handling(EH_THROW, NULL, &error_handling TSRMLS_CC); - + if (zend_parse_parameters(argc TSRMLS_CC, "lss|ll", &version, &a1, &a1_len, &a2, &a2_len, &timeout, &retries) == FAILURE) { zend_restore_error_handling(&error_handling TSRMLS_CC); return; @@ -1841,7 +1841,7 @@ PHP_METHOD(snmp, __construct) if (snmp_object->session) { netsnmp_session_free(&(snmp_object->session)); } - + if (netsnmp_session_init(&(snmp_object->session), version, a1, a2, timeout, retries TSRMLS_CC)) { return; } @@ -1855,7 +1855,7 @@ PHP_METHOD(snmp, __construct) } /* }}} */ -/* {{{ proto bool SNMP::close() +/* {{{ proto bool SNMP::close() Close SNMP session */ PHP_METHOD(snmp, close) { @@ -1898,7 +1898,7 @@ PHP_METHOD(snmp, walk) } /* }}} */ -/* {{{ proto bool SNMP::set(mixed object_id, mixed type, mixed value) +/* {{{ proto bool SNMP::set(mixed object_id, mixed type, mixed value) Set the value of a SNMP object */ PHP_METHOD(snmp, set) { @@ -1916,7 +1916,7 @@ PHP_METHOD(snmp, setSecurity) int argc = ZEND_NUM_ARGS(); snmp_object = (php_snmp_object *)zend_object_store_get_object(object TSRMLS_CC); - + if (zend_parse_parameters(argc TSRMLS_CC, "s|ssssss", &a1, &a1_len, &a2, &a2_len, &a3, &a3_len, &a4, &a4_len, &a5, &a5_len, &a6, &a6_len, &a7, &a7_len) == FAILURE) { RETURN_FALSE; @@ -1930,7 +1930,7 @@ PHP_METHOD(snmp, setSecurity) } /* }}} */ -/* {{{ proto long SNMP::getErrno() +/* {{{ proto long SNMP::getErrno() Get last error code number */ PHP_METHOD(snmp, getErrno) { @@ -1944,7 +1944,7 @@ PHP_METHOD(snmp, getErrno) } /* }}} */ -/* {{{ proto long SNMP::getError() +/* {{{ proto long SNMP::getError() Get last error message */ PHP_METHOD(snmp, getError) { @@ -2093,6 +2093,14 @@ static int php_snmp_has_property(zval *object, zval *member, int has_set_exists, } /* }}} */ +static HashTable *php_snmp_get_gc(zval *object, zval ***gc_data, int *gc_data_count TSRMLS_DC) /* {{{ */ +{ + *gc_data = NULL; + *gc_data_count = 0; + return zend_std_get_properties(object TSRMLS_CC); +} +/* }}} */ + /* {{{ php_snmp_get_properties(zval *object) Returns all object properties. Injects SNMP properties into object on first call */ static HashTable *php_snmp_get_properties(zval *object TSRMLS_DC) @@ -2135,23 +2143,23 @@ static int php_snmp_read_info(php_snmp_object *snmp_object, zval **retval TSRMLS if (snmp_object->session == NULL) { return SUCCESS; } - + MAKE_STD_ZVAL(val); ZVAL_STRINGL(val, snmp_object->session->peername, strlen(snmp_object->session->peername), 1); add_assoc_zval(*retval, "hostname", val); - + MAKE_STD_ZVAL(val); ZVAL_LONG(val, snmp_object->session->remote_port); add_assoc_zval(*retval, "port", val); - + MAKE_STD_ZVAL(val); ZVAL_LONG(val, snmp_object->session->timeout); add_assoc_zval(*retval, "timeout", val); - + MAKE_STD_ZVAL(val); ZVAL_LONG(val, snmp_object->session->retries); add_assoc_zval(*retval, "retries", val); - + return SUCCESS; } /* }}} */ @@ -2224,7 +2232,7 @@ static int php_snmp_write_max_oids(php_snmp_object *snmp_object, zval *newval TS } else { php_error_docref(NULL TSRMLS_CC, E_WARNING, "max_oids should be positive integer or NULL, got %ld", Z_LVAL_P(newval)); } - + if (newval == &ztmp) { zval_dtor(newval); } @@ -2252,7 +2260,7 @@ static int php_snmp_write_valueretrieval(php_snmp_object *snmp_object, zval *new php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown SNMP value retrieval method '%ld'", Z_LVAL_P(newval)); ret = FAILURE; } - + if (newval == &ztmp) { zval_dtor(newval); } @@ -2295,7 +2303,7 @@ static int php_snmp_write_oid_output_format(php_snmp_object *snmp_object, zval * convert_to_long(&ztmp); newval = &ztmp; } - + switch(Z_LVAL_P(newval)) { case NETSNMP_OID_OUTPUT_SUFFIX: case NETSNMP_OID_OUTPUT_MODULE: @@ -2330,7 +2338,7 @@ static int php_snmp_write_exceptions_enabled(php_snmp_object *snmp_object, zval newval = &ztmp; } - snmp_object->exceptions_enabled = Z_LVAL_P(newval); + snmp_object->exceptions_enabled = Z_LVAL_P(newval); if (newval == &ztmp) { zval_dtor(newval); @@ -2399,6 +2407,7 @@ PHP_MINIT_FUNCTION(snmp) php_snmp_object_handlers.write_property = php_snmp_write_property; php_snmp_object_handlers.has_property = php_snmp_has_property; php_snmp_object_handlers.get_properties = php_snmp_get_properties; + php_snmp_object_handlers.get_gc = php_snmp_get_gc; /* Register SNMP Class */ INIT_CLASS_ENTRY(ce, "SNMP", php_snmp_class_methods); @@ -2465,7 +2474,7 @@ PHP_MINIT_FUNCTION(snmp) PHP_MSHUTDOWN_FUNCTION(snmp) { snmp_shutdown("snmpapp"); - + zend_hash_destroy(&php_snmp_properties); return SUCCESS; diff --git a/ext/snmp/tests/bug72479.phpt b/ext/snmp/tests/bug72479.phpt new file mode 100644 index 0000000000000..0308754360254 --- /dev/null +++ b/ext/snmp/tests/bug72479.phpt @@ -0,0 +1,35 @@ +--TEST-- +Bug #72479: Use After Free Vulnerability in SNMP with GC and unserialize() +--SKIPIF-- + +--FILE-- +>= 8; + } + return $out; +} +?> +--EXPECT-- +int(1) \ No newline at end of file diff --git a/ext/sockets/tests/socket_cmsg_credentials.phpt b/ext/sockets/tests/socket_cmsg_credentials.phpt index 6a1c23fa8c56f..922be0bb37b2e 100644 --- a/ext/sockets/tests/socket_cmsg_credentials.phpt +++ b/ext/sockets/tests/socket_cmsg_credentials.phpt @@ -8,6 +8,9 @@ die('skip sockets extension not available.'); if (strtolower(substr(PHP_OS, 0, 3)) == 'win') { die('skip not for Microsoft Windows'); } +if (strtolower(substr(PHP_OS, 0, 3)) == 'aix') { +die('skip not for AIX'); +} --CLEAN-- u.file.enclosure; enclosure[1] = '\0'; + escape[0] = intern->u.file.escape; + escape[1] = '\0'; add_next_index_string(return_value, delimiter, 1); add_next_index_string(return_value, enclosure, 1); + add_next_index_string(return_value, escape, 1); } /* }}} */ diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index c6181d922d313..a023b11829e12 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -481,7 +481,9 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|lzl", &iterator, &flags, &user_caching_it_flags, &mode) == SUCCESS) { if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate TSRMLS_CC)) { zval *aggregate = iterator; + zend_restore_error_handling(&error_handling TSRMLS_CC); zend_call_method_with_0_params(&aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", &iterator); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); inc_refcount = 0; } @@ -511,7 +513,9 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "o|ll", &iterator, &mode, &flags) == SUCCESS) { if (instanceof_function(Z_OBJCE_P(iterator), zend_ce_aggregate TSRMLS_CC)) { zval *aggregate = iterator; + zend_restore_error_handling(&error_handling TSRMLS_CC); zend_call_method_with_0_params(&aggregate, Z_OBJCE_P(aggregate), &Z_OBJCE_P(aggregate)->iterator_funcs.zf_new_iterator, "getiterator", &iterator); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); inc_refcount = 0; } } else { @@ -1514,7 +1518,9 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z ce = *pce_cast; } if (instanceof_function(ce, zend_ce_aggregate TSRMLS_CC)) { + zend_restore_error_handling(&error_handling TSRMLS_CC); zend_call_method_with_0_params(&zobject, ce, &ce->iterator_funcs.zf_new_iterator, "getiterator", &retval); + zend_replace_error_handling(EH_THROW, spl_ce_InvalidArgumentException, &error_handling TSRMLS_CC); if (EG(exception)) { if (retval) { zval_ptr_dtor(&retval); @@ -1682,7 +1688,7 @@ static inline void spl_dual_it_rewind(spl_dual_it_object *intern TSRMLS_DC) { spl_dual_it_free(intern TSRMLS_CC); intern->current.pos = 0; - if (intern->inner.iterator->funcs->rewind) { + if (intern->inner.iterator && intern->inner.iterator->funcs->rewind) { intern->inner.iterator->funcs->rewind(intern->inner.iterator TSRMLS_CC); } } diff --git a/ext/spl/tests/SplFileObject_getCsvControl_basic_001.phpt b/ext/spl/tests/SplFileObject_getCsvControl_basic_001.phpt index e21f08fa2de74..4e3de4bab2eb2 100644 --- a/ext/spl/tests/SplFileObject_getCsvControl_basic_001.phpt +++ b/ext/spl/tests/SplFileObject_getCsvControl_basic_001.phpt @@ -6,10 +6,12 @@ $obj = New SplFileObject(dirname(__FILE__).'/SplFileObject_testinput.csv'); var_dump($obj->getCsvControl()); ?> ---EXPECTF-- -array(2) { +--EXPECT-- +array(3) { [0]=> - %unicode|string%(1) "," + string(1) "," [1]=> - %unicode|string%(1) """ + string(1) """ + [2]=> + string(1) "\" } diff --git a/ext/spl/tests/bug72122.phpt b/ext/spl/tests/bug72122.phpt new file mode 100644 index 0000000000000..7edc5eaf91d22 --- /dev/null +++ b/ext/spl/tests/bug72122.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #72122 (IteratorIterator breaks '@' error suppression) +--FILE-- + +--EXPECT-- +IteratorIterator \ No newline at end of file diff --git a/ext/spl/tests/bug72684.phpt b/ext/spl/tests/bug72684.phpt new file mode 100644 index 0000000000000..7a99901f5343e --- /dev/null +++ b/ext/spl/tests/bug72684.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #72684 (AppendIterator segfault with closed generator) +--FILE-- +append($generator); + +iterator_to_array($appendIterator); +try { + iterator_to_array($appendIterator); +} catch (\Exception $e) { + echo $e->getMessage(); +} + +?> +--EXPECT-- +Cannot traverse an already closed generator diff --git a/ext/sqlite3/sqlite3.c b/ext/sqlite3/sqlite3.c index 4513b77d0f93f..54ec73d6ac621 100644 --- a/ext/sqlite3/sqlite3.c +++ b/ext/sqlite3/sqlite3.c @@ -118,13 +118,11 @@ PHP_METHOD(sqlite3, open) if (db_obj->initialised) { zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Already initialised DB Object", 0 TSRMLS_CC); - } - - if (strlen(filename) != filename_len) { return; } - if (filename_len != sizeof(":memory:")-1 || - memcmp(filename, ":memory:", sizeof(":memory:")-1) != 0) { + + if (filename_len != 0 && (filename_len != sizeof(":memory:")-1 || + memcmp(filename, ":memory:", sizeof(":memory:")-1) != 0)) { if (!(fullpath = expand_filepath(filename, NULL TSRMLS_CC))) { zend_throw_exception(zend_exception_get_default(TSRMLS_C), "Unable to expand filepath", 0 TSRMLS_CC); return; @@ -144,7 +142,8 @@ PHP_METHOD(sqlite3, open) return; } } else { - fullpath = estrdup(filename); + /* filename equals "" or ":memory:" */ + fullpath = filename; } #if SQLITE_VERSION_NUMBER >= 3005000 @@ -153,7 +152,7 @@ PHP_METHOD(sqlite3, open) if (sqlite3_open(fullpath, &(db_obj->db)) != SQLITE_OK) { #endif zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Unable to open database: %s", sqlite3_errmsg(db_obj->db)); - if (fullpath) { + if (fullpath != filename) { efree(fullpath); } return; @@ -178,7 +177,7 @@ PHP_METHOD(sqlite3, open) sqlite3_set_authorizer(db_obj->db, php_sqlite3_authorizer, NULL); } - if (fullpath) { + if (fullpath != filename) { efree(fullpath); } } @@ -578,7 +577,9 @@ PHP_METHOD(sqlite3, query) break; } default: - php_sqlite3_error(db_obj, "Unable to execute statement: %s", sqlite3_errmsg(db_obj->db)); + if (!EG(exception)) { + php_sqlite3_error(db_obj, "Unable to execute statement: %s", sqlite3_errmsg(db_obj->db)); + } sqlite3_finalize(stmt_obj->stmt); stmt_obj->initialised = 0; zval_dtor(return_value); @@ -690,7 +691,9 @@ PHP_METHOD(sqlite3, querySingle) break; } default: - php_sqlite3_error(db_obj, "Unable to execute statement: %s", sqlite3_errmsg(db_obj->db)); + if (!EG(exception)) { + php_sqlite3_error(db_obj, "Unable to execute statement: %s", sqlite3_errmsg(db_obj->db)); + } RETVAL_FALSE; } sqlite3_finalize(stmt); @@ -1637,7 +1640,9 @@ PHP_METHOD(sqlite3stmt, execute) sqlite3_reset(stmt_obj->stmt); default: - php_sqlite3_error(stmt_obj->db_obj, "Unable to execute statement: %s", sqlite3_errmsg(sqlite3_db_handle(stmt_obj->stmt))); + if (!EG(exception)) { + php_sqlite3_error(stmt_obj->db_obj, "Unable to execute statement: %s", sqlite3_errmsg(sqlite3_db_handle(stmt_obj->stmt))); + } zval_dtor(return_value); RETURN_FALSE; } diff --git a/ext/sqlite3/tests/bug72668.phpt b/ext/sqlite3/tests/bug72668.phpt new file mode 100644 index 0000000000000..2845fa0a7caec --- /dev/null +++ b/ext/sqlite3/tests/bug72668.phpt @@ -0,0 +1,41 @@ +--TEST-- +Bug #72668 (Spurious warning when exception is thrown in user defined function) +--SKIPIF-- + +--FILE-- +createFunction('my_udf_md5', 'my_udf_md5'); + +try { + $result = $db->query('SELECT my_udf_md5("test")'); + var_dump($result); +} +catch(\Exception $e) { + echo "Exception: ".$e->getMessage(); +} +try { + $result = $db->querySingle('SELECT my_udf_md5("test")'); + var_dump($result); +} +catch(\Exception $e) { + echo "Exception: ".$e->getMessage(); +} +$statement = $db->prepare('SELECT my_udf_md5("test")'); +try { + $result = $statement->execute(); + var_dump($result); +} +catch(\Exception $e) { + echo "Exception: ".$e->getMessage(); +} +?> +--EXPECT-- +Exception: test exception +Exception: test exception +Exception: test exception diff --git a/ext/sqlite3/tests/sqlite3_open_empty_string.phpt b/ext/sqlite3/tests/sqlite3_open_empty_string.phpt index 86868eeed14b0..940056bf0aee3 100644 --- a/ext/sqlite3/tests/sqlite3_open_empty_string.phpt +++ b/ext/sqlite3/tests/sqlite3_open_empty_string.phpt @@ -7,13 +7,8 @@ Thijs Feryn --FILE-- getMessage().PHP_EOL; -} +$db = new SQLite3(''); echo "Done\n"; ?> ---EXPECTF-- -Unable to expand filepath +--EXPECT-- Done diff --git a/ext/standard/base64.c b/ext/standard/base64.c index a40b86634d31c..b30a5b73b169e 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -66,6 +66,12 @@ PHPAPI unsigned char *php_base64_encode(const unsigned char *str, int length, in return NULL; } + if (((size_t)length + 2) / 3 > INT_MAX/4 ) { + TSRMLS_FETCH(); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "String too long, maximum is %d", INT_MAX/4); + return NULL; + } + result = (unsigned char *) safe_emalloc((length + 2) / 3, 4 * sizeof(char), 1); p = result; diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 57de98b15db74..1ea19066a8ab3 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -636,8 +636,9 @@ ZEND_BEGIN_ARG_INFO(arginfo_long2ip, 0) ZEND_ARG_INFO(0, proper_address) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO(arginfo_getenv, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_getenv, 0, 0, 1) ZEND_ARG_INFO(0, varname) + ZEND_ARG_INFO(0, local_only) ZEND_END_ARG_INFO() #ifdef HAVE_PUTENV @@ -3986,21 +3987,24 @@ PHP_FUNCTION(long2ip) * System Functions * ********************/ -/* {{{ proto string getenv(string varname) +/* {{{ proto string getenv(string varname[, bool local_only]) Get the value of an environment variable */ PHP_FUNCTION(getenv) { char *ptr, *str; int str_len; + zend_bool local_only = 0; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &str, &str_len, &local_only) == FAILURE) { RETURN_FALSE; } - /* SAPI method returns an emalloc()'d string */ - ptr = sapi_getenv(str, str_len TSRMLS_CC); - if (ptr) { - RETURN_STRING(ptr, 0); + if (!local_only) { + /* SAPI method returns an emalloc()'d string */ + ptr = sapi_getenv(str, str_len TSRMLS_CC); + if (ptr) { + RETURN_STRING(ptr, 0); + } } #ifdef PHP_WIN32 { diff --git a/ext/standard/browscap.c b/ext/standard/browscap.c index 2b75135640efa..36def7183877f 100644 --- a/ext/standard/browscap.c +++ b/ext/standard/browscap.c @@ -123,6 +123,10 @@ static void convert_browscap_pattern(zval *pattern, int persistent) /* {{{ */ t[j++] = '\\'; t[j] = '~'; break; + case '+': + t[j++] = '\\'; + t[j] = '+'; + break; default: t[j] = Z_STRVAL_P(pattern)[i]; break; diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 1b83d6e127708..10f19ff113d10 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -201,6 +201,14 @@ PHPAPI int php_crypt(const char *password, const int pass_len, const char *salt, salt[5] >= '0' && salt[5] <= '9' && salt[6] == '$') { char output[PHP_MAX_SALT_LEN + 1]; + int k = 7; + + while (isalnum(salt[k]) || '.' == salt[k] || '/' == salt[k]) { + k++; + } + if (k != salt_len) { + return FAILURE; + } memset(output, 0, PHP_MAX_SALT_LEN + 1); diff --git a/ext/standard/file.c b/ext/standard/file.c index f8c4e0450bc39..d346ed9e92263 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1512,6 +1512,11 @@ PHP_NAMED_FUNCTION(php_if_ftruncate) RETURN_FALSE; } + if (size < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Negative size is not supported"); + RETURN_FALSE; + } + PHP_STREAM_TO_ZVAL(stream, &fp); if (!php_stream_truncate_supported(stream)) { @@ -2219,6 +2224,7 @@ PHPAPI void php_fgetcsv(php_stream *stream, char delimiter, char enclosure, char memcpy(tptr, hunk_begin, bptr - hunk_begin); tptr += (bptr - hunk_begin); hunk_begin = bptr; + state = 0; break; default: bptr += inc_len; diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index b290b65095f76..5bffa47855c1e 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -82,6 +82,7 @@ typedef struct _php_ftp_dirstream_data { */ static inline int get_ftp_result(php_stream *stream, char *buffer, size_t buffer_size TSRMLS_DC) { + buffer[0] = '\0'; /* in case read fails to read anything */ while (php_stream_gets(stream, buffer, buffer_size-1) && !(isdigit((int) buffer[0]) && isdigit((int) buffer[1]) && isdigit((int) buffer[2]) && buffer[3] == ' ')); @@ -105,7 +106,7 @@ static int php_stream_ftp_stream_close(php_stream_wrapper *wrapper, php_stream * { php_stream *controlstream = stream->wrapperthis; int ret = 0; - + if (controlstream) { if (strpbrk(stream->mode, "wa+")) { char tmp_line[512]; @@ -154,7 +155,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char /* use port 21 if one wasn't specified */ if (resource->port == 0) resource->port = 21; - + transport_len = spprintf(&transport, 0, "tcp://%s:%d", resource->host, resource->port); stream = php_stream_xport_create(transport, transport_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, NULL, NULL, context, NULL, NULL); efree(transport); @@ -174,7 +175,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char } if (use_ssl) { - + /* send the AUTH TLS request name */ php_stream_write_string(stream, "AUTH TLS\r\n"); @@ -183,11 +184,12 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char if (result != 234) { /* AUTH TLS not supported try AUTH SSL */ php_stream_write_string(stream, "AUTH SSL\r\n"); - + /* get the response */ result = GET_FTP_RESULT(stream); if (result != 334) { - use_ssl = 0; + php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Server doesn't support FTPS."); + goto connect_errexit; } else { /* we must reuse the old SSL session id */ /* if we talk to an old ftpd-ssl */ @@ -200,7 +202,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char } } - + if (use_ssl) { if (php_stream_xport_crypto_setup(stream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 @@ -210,13 +212,13 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char stream = NULL; goto connect_errexit; } - + /* set PBSZ to 0 */ php_stream_write_string(stream, "PBSZ 0\r\n"); /* ignore the response */ result = GET_FTP_RESULT(stream); - + /* set data connection protection level */ #if FTPS_ENCRYPT_DATA php_stream_write_string(stream, "PROT P\r\n"); @@ -241,7 +243,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char } \ s++; \ } \ -} +} /* send the user name */ if (resource->user != NULL) { @@ -253,10 +255,10 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char } else { php_stream_write_string(stream, "USER anonymous\r\n"); } - + /* get the response */ result = GET_FTP_RESULT(stream); - + /* if a password is required, send it */ if (result >= 300 && result <= 399) { php_stream_notify_info(context, PHP_STREAM_NOTIFY_AUTH_REQUIRED, tmp_line, 0); @@ -307,7 +309,7 @@ static php_stream *php_ftp_fopen_connect(php_stream_wrapper *wrapper, const char connect_errexit: if (resource) { - php_url_free(resource); + php_url_free(resource); } if (stream) { @@ -338,7 +340,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_ /* EPSV failed, let's try PASV */ php_stream_write_string(stream, "PASV\r\n"); result = GET_FTP_RESULT(stream); - + /* make sure we got a 227 response */ if (result != 227) { return 0; @@ -358,14 +360,14 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_ if (*tpath != ',') { return 0; } - *tpath='.'; + *tpath='.'; tpath++; } tpath[-1] = '\0'; memcpy(ip, hoststart, ip_size); ip[ip_size-1] = '\0'; hoststart = ip; - + /* pull out the MSB of the port */ portno = (unsigned short) strtoul(tpath, &ttpath, 10) * 256; if (ttpath == NULL) { @@ -395,7 +397,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_ /* pull out the port */ portno = (unsigned short) strtoul(tpath + 1, &ttpath, 10); } -#endif +#endif if (ttpath == NULL) { /* didn't get correct response from EPSV/PASV */ return 0; @@ -403,7 +405,7 @@ static unsigned short php_fopen_do_pasv(php_stream *stream, char *ip, size_t ip_ if (phoststart) { *phoststart = hoststart; - } + } return portno; } @@ -473,28 +475,28 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa result = GET_FTP_RESULT(stream); if (result > 299 || result < 200) goto errexit; - + /* find out the size of the file (verifying it exists) */ php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", resource->path); - + /* read the response */ result = GET_FTP_RESULT(stream); if (read_write == 1) { /* Read Mode */ char *sizestr; - + /* when reading file, it must exist */ if (result > 299 || result < 200) { errno = ENOENT; goto errexit; } - + sizestr = strchr(tmp_line, ' '); if (sizestr) { sizestr++; file_size = atoi(sizestr); php_stream_notify_file_size(context, file_size, tmp_line, result); - } + } } else if (read_write == 2) { /* when writing file (but not appending), it must NOT exist, unless a context option exists which allows it */ if (context && php_stream_context_get_option(context, "ftp", "overwrite", &tmpzval) == SUCCESS) { @@ -502,7 +504,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } if (result <= 299 && result >= 200) { if (allow_overwrite) { - /* Context permits overwriting file, + /* Context permits overwriting file, so we just delete whatever's there in preparation */ php_stream_printf(stream TSRMLS_CC, "DELE %s\r\n", resource->path); result = GET_FTP_RESULT(stream); @@ -533,7 +535,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa Z_LVAL_PP(tmpzval) > 0) { php_stream_printf(stream TSRMLS_CC, "REST %ld\r\n", Z_LVAL_PP(tmpzval)); result = GET_FTP_RESULT(stream); - if (result < 300 || result > 399) { + if (result < 300 || result > 399) { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to resume from offset %ld", Z_LVAL_PP(tmpzval)); goto errexit; } @@ -547,9 +549,9 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa } else { /* Append */ memcpy(tmp_line, "APPE", sizeof("APPE")); - } + } php_stream_printf(stream TSRMLS_CC, "%s %s\r\n", tmp_line, (resource->path != NULL ? resource->path : "/")); - + /* open the data channel */ if (hoststart == NULL) { hoststart = resource->host; @@ -563,14 +565,14 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa result = GET_FTP_RESULT(stream); if (result != 150 && result != 125) { - /* Could not retrieve or send the file + /* Could not retrieve or send the file * this data will only be sent to us after connection on the data port was initiated. */ php_stream_close(datastream); datastream = NULL; - goto errexit; + goto errexit; } - + php_stream_context_set(datastream, context); php_stream_notify_progress_init(context, 0, file_size); @@ -584,7 +586,7 @@ php_stream * php_stream_url_wrap_ftp(php_stream_wrapper *wrapper, const char *pa goto errexit; } - /* remember control stream */ + /* remember control stream */ datastream->wrapperthis = stream; php_url_free(resource); @@ -668,7 +670,7 @@ static int php_ftp_dirstream_close(php_stream *stream, int close_handle TSRMLS_D /* close data connection */ php_stream_close(data->datastream); data->datastream = NULL; - + efree(data); stream->abstract = NULL; @@ -707,7 +709,7 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat stream = php_ftp_fopen_connect(wrapper, path, mode, options, opened_path, context, &reuseid, &resource, &use_ssl, &use_ssl_on_data TSRMLS_CC); if (!stream) { - goto opendir_errexit; + goto opendir_errexit; } /* set the connection to be ascii */ @@ -716,6 +718,9 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat if (result > 299 || result < 200) goto opendir_errexit; + // tmp_line isn't relevant after the php_fopen_do_pasv(). + tmp_line[0] = '\0'; + /* set up the passive connection */ portno = php_fopen_do_pasv(stream, ip, sizeof(ip), &hoststart TSRMLS_CC); @@ -723,32 +728,33 @@ php_stream * php_stream_ftp_opendir(php_stream_wrapper *wrapper, const char *pat goto opendir_errexit; } - php_stream_printf(stream TSRMLS_CC, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/")); - /* open the data channel */ if (hoststart == NULL) { hoststart = resource->host; } + datastream = php_stream_sock_open_host(hoststart, portno, SOCK_STREAM, 0, 0); if (datastream == NULL) { goto opendir_errexit; } + + php_stream_printf(stream TSRMLS_CC, "NLST %s\r\n", (resource->path != NULL ? resource->path : "/")); + result = GET_FTP_RESULT(stream); if (result != 150 && result != 125) { - /* Could not retrieve or send the file + /* Could not retrieve or send the file * this data will only be sent to us after connection on the data port was initiated. */ php_stream_close(datastream); datastream = NULL; - goto opendir_errexit; + goto opendir_errexit; } - - php_stream_context_set(datastream, context); - if (use_ssl_on_data && (php_stream_xport_crypto_setup(stream, + php_stream_context_set(datastream, context); + if (use_ssl_on_data && (php_stream_xport_crypto_setup(datastream, STREAM_CRYPTO_METHOD_SSLv23_CLIENT, NULL TSRMLS_CC) < 0 || - php_stream_xport_crypto_enable(stream, 1 TSRMLS_CC) < 0)) { + php_stream_xport_crypto_enable(datastream, 1 TSRMLS_CC) < 0)) { php_stream_wrapper_log_error(wrapper, options TSRMLS_CC, "Unable to activate SSL mode"); php_stream_close(datastream); @@ -807,17 +813,17 @@ static int php_stream_ftp_url_stat(php_stream_wrapper *wrapper, const char *url, } php_stream_write_string(stream, "TYPE I\r\n"); /* we need this since some servers refuse to accept SIZE command in ASCII mode */ - + result = GET_FTP_RESULT(stream); if(result < 200 || result > 299) { goto stat_errexit; } - + php_stream_printf(stream TSRMLS_CC, "SIZE %s\r\n", (resource->path != NULL ? resource->path : "/")); result = GET_FTP_RESULT(stream); if (result < 200 || result > 299) { - /* Failure either means it doesn't exist + /* Failure either means it doesn't exist or it's a directory and this server fails on listing directory sizes */ if (ssb->sb.st_mode & S_IFDIR) { @@ -964,8 +970,8 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr resource_from = php_url_parse(url_from); resource_to = php_url_parse(url_to); - /* Must be same scheme (ftp/ftp or ftps/ftps), same host, and same port - (or a 21/0 0/21 combination which is also "same") + /* Must be same scheme (ftp/ftp or ftps/ftps), same host, and same port + (or a 21/0 0/21 combination which is also "same") Also require paths to/from */ if (!resource_from || !resource_to || @@ -975,8 +981,8 @@ static int php_stream_ftp_rename(php_stream_wrapper *wrapper, const char *url_fr !resource_from->host || !resource_to->host || strcmp(resource_from->host, resource_to->host) || - (resource_from->port != resource_to->port && - resource_from->port * resource_to->port != 0 && + (resource_from->port != resource_to->port && + resource_from->port * resource_to->port != 0 && resource_from->port + resource_to->port != 21) || !resource_from->path || !resource_to->path) { diff --git a/ext/standard/image.c b/ext/standard/image.c index f20482bde487d..d58d543abdcae 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -374,48 +374,36 @@ static unsigned short php_read2(php_stream * stream TSRMLS_DC) /* {{{ php_next_marker * get next marker byte from file */ -static unsigned int php_next_marker(php_stream * stream, int last_marker, int comment_correction, int ff_read TSRMLS_DC) +static unsigned int php_next_marker(php_stream * stream, int last_marker, int ff_read TSRMLS_DC) { int a=0, marker; /* get marker byte, swallowing possible padding */ - if (last_marker==M_COM && comment_correction) { - /* some software does not count the length bytes of COM section */ - /* one company doing so is very much envolved in JPEG... so we accept too */ - /* by the way: some of those companies changed their code now... */ - comment_correction = 2; - } else { - last_marker = 0; - comment_correction = 0; - } - if (ff_read) { - a = 1; /* already read 0xff in filetype detection */ + if (!ff_read) { + size_t extraneous = 0; + + while ((marker = php_stream_getc(stream)) != 0xff) { + if (marker == EOF) { + return M_EOI;/* we hit EOF */ + } + extraneous++; + } + if (extraneous) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "corrupt JPEG data: %zu extraneous bytes before marker", extraneous); + } } + a = 1; do { if ((marker = php_stream_getc(stream)) == EOF) { return M_EOI;/* we hit EOF */ } - if (last_marker==M_COM && comment_correction>0) - { - if (marker != 0xFF) - { - marker = 0xff; - comment_correction--; - } else { - last_marker = M_PSEUDO; /* stop skipping non 0xff for M_COM */ - } - } a++; } while (marker == 0xff); if (a < 2) { return M_EOI; /* at least one 0xff is needed before marker code */ } - if ( last_marker==M_COM && comment_correction) - { - return M_EOI; /* ah illegal: char after COM section not 0xFF */ - } return (unsigned int)marker; } /* }}} */ @@ -478,7 +466,7 @@ static struct gfxinfo *php_handle_jpeg (php_stream * stream, zval *info TSRMLS_D unsigned short length, ff_read=1; for (;;) { - marker = php_next_marker(stream, marker, 1, ff_read TSRMLS_CC); + marker = php_next_marker(stream, marker, ff_read TSRMLS_CC); ff_read = 0; switch (marker) { case M_SOF0: diff --git a/ext/standard/quot_print.c b/ext/standard/quot_print.c index 3b8c0eca1f8f5..6d5835e9a2453 100644 --- a/ext/standard/quot_print.c +++ b/ext/standard/quot_print.c @@ -144,7 +144,7 @@ PHPAPI unsigned char *php_quot_print_decode(const unsigned char *str, size_t len /* }}} */ #define PHP_QPRINT_MAXL 75 - + PHPAPI unsigned char *php_quot_print_encode(const unsigned char *str, size_t length, size_t *ret_length) /* {{{ */ { unsigned long lp = 0; @@ -162,9 +162,9 @@ PHPAPI unsigned char *php_quot_print_encode(const unsigned char *str, size_t len lp = 0; } else { if (iscntrl (c) || (c == 0x7f) || (c & 0x80) || (c == '=') || ((c == ' ') && (*str == '\015'))) { - if ((((lp+= 3) > PHP_QPRINT_MAXL) && (c <= 0x7f)) - || ((c > 0x7f) && (c <= 0xdf) && ((lp + 3) > PHP_QPRINT_MAXL)) - || ((c > 0xdf) && (c <= 0xef) && ((lp + 6) > PHP_QPRINT_MAXL)) + if ((((lp+= 3) > PHP_QPRINT_MAXL) && (c <= 0x7f)) + || ((c > 0x7f) && (c <= 0xdf) && ((lp + 3) > PHP_QPRINT_MAXL)) + || ((c > 0xdf) && (c <= 0xef) && ((lp + 6) > PHP_QPRINT_MAXL)) || ((c > 0xef) && (c <= 0xf4) && ((lp + 9) > PHP_QPRINT_MAXL))) { *d++ = '='; *d++ = '\015'; @@ -208,7 +208,7 @@ PHP_FUNCTION(quoted_printable_decode) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg1, &arg1_len) == FAILURE) { return; } - + if (arg1_len == 0) { /* shortcut */ RETURN_EMPTY_STRING(); @@ -219,11 +219,11 @@ PHP_FUNCTION(quoted_printable_decode) while (str_in[i]) { switch (str_in[i]) { case '=': - if (str_in[i + 1] && str_in[i + 2] && - isxdigit((int) str_in[i + 1]) && + if (str_in[i + 1] && str_in[i + 2] && + isxdigit((int) str_in[i + 1]) && isxdigit((int) str_in[i + 2])) { - str_out[j++] = (php_hex2int((int) str_in[i + 1]) << 4) + str_out[j++] = (php_hex2int((int) str_in[i + 1]) << 4) + php_hex2int((int) str_in[i + 2]); i += 3; } else /* check for soft line break according to RFC 2045*/ { @@ -254,7 +254,7 @@ PHP_FUNCTION(quoted_printable_decode) } } str_out[j] = '\0'; - + RETVAL_STRINGL(str_out, j, 0); } /* }}} */ @@ -275,6 +275,11 @@ PHP_FUNCTION(quoted_printable_encode) } new_str = (char *)php_quot_print_encode((unsigned char *)str, (size_t)str_len, &new_str_len); + if (new_str_len > INT_MAX) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "String too long, max length is %d", INT_MAX); + efree(new_str); + RETURN_FALSE; + } RETURN_STRINGL(new_str, new_str_len, 0); } /* }}} */ diff --git a/ext/standard/string.c b/ext/standard/string.c index 39413c8211707..9498496fce84e 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -195,7 +195,6 @@ static char *php_hex2bin(const unsigned char *old, const size_t oldlen, size_t * * glibc's localeconv is not reentrant, so lets make it so ... sorta */ PHPAPI struct lconv *localeconv_r(struct lconv *out) { - struct lconv *res; # ifdef ZTS tsrm_mutex_lock( locale_mutex ); @@ -206,16 +205,14 @@ PHPAPI struct lconv *localeconv_r(struct lconv *out) /* Even with the enabled per thread locale, localeconv won't check any locale change in the master thread. */ _locale_t cur = _get_current_locale(); - - res = cur->locinfo->lconv; + *out = *cur->locinfo->lconv; + _free_locale(cur); } #else /* localeconv doesn't return an error condition */ - res = localeconv(); + *out = *localeconv(); #endif - *out = *res; - # ifdef ZTS tsrm_mutex_unlock( locale_mutex ); # endif @@ -2992,7 +2989,7 @@ static PPRES *php_strtr_array_prepare(STR *text, PATNREPL *patterns, int patnum, res->m = L(&patterns[i].pat); } } - assert(res->m > 0); + assert(res->m > 0 && res->m != (STRLEN)-1); res->B = B = MIN(B, res->m); res->Bp = Bp = MIN(Bp, res->m); @@ -3134,6 +3131,12 @@ static void php_strtr_array(zval *return_value, char *str, int slen, HashTable * if (patterns == NULL) { RETURN_FALSE; } + if (patterns_len == 0) { + efree(patterns); + zend_llist_destroy(allocs); + efree(allocs); + RETURN_STRINGL(str, slen, 1); + } data = php_strtr_array_prepare(&text, patterns, patterns_len, 2, 2); efree(patterns); php_strtr_array_do_repl(&text, data, return_value); diff --git a/ext/standard/tests/file/bug71882.phpt b/ext/standard/tests/file/bug71882.phpt new file mode 100644 index 0000000000000..ae0137b5999ae --- /dev/null +++ b/ext/standard/tests/file/bug71882.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #71882 (Negative ftruncate() on php://memory exhausts memory) +--FILE-- + +==DONE== +--EXPECTF-- +Warning: ftruncate(): Negative size is not supported in %s%ebug71882.php on line %d +==DONE== diff --git a/ext/standard/tests/file/bug72330.phpt b/ext/standard/tests/file/bug72330.phpt new file mode 100644 index 0000000000000..843032ae2d948 --- /dev/null +++ b/ext/standard/tests/file/bug72330.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #72330 (CSV fields incorrectly split if escape char followed by UTF chars) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +array(2) { + [0]=> + string(11) "first #с؀" + [1]=> + string(6) "second" +} diff --git a/ext/standard/tests/general_functions/url_rewriter.phpt b/ext/standard/tests/general_functions/url_rewriter.phpt new file mode 100644 index 0000000000000..ce91b27a00351 --- /dev/null +++ b/ext/standard/tests/general_functions/url_rewriter.phpt @@ -0,0 +1,139 @@ +--TEST-- +URL Rewriter tests +--INI-- +url_rewriter.tags="a=href,form=" +session.use_only_cookies=0 +session.use_trans_sid=1 +session.use_strict_mode=0 +--FILE-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ +
+
+
+
+
+--EXPECT-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+ +
+
+
+
+
diff --git a/ext/standard/tests/image/bug13213.phpt b/ext/standard/tests/image/bug13213.phpt index c97b7016b4162..d6b82a4f0cb18 100644 --- a/ext/standard/tests/image/bug13213.phpt +++ b/ext/standard/tests/image/bug13213.phpt @@ -4,7 +4,8 @@ Bug #13213 (GetImageSize and wrong JPEG Comments) ---EXPECT-- +--EXPECTF-- +Warning: getimagesize(): corrupt JPEG data: 2 extraneous bytes before marker in %s%ebug13213.php on line %d array(7) { [0]=> int(1) diff --git a/ext/standard/tests/image/bug72278.jpg b/ext/standard/tests/image/bug72278.jpg new file mode 100644 index 0000000000000..2ef32410cf2e7 Binary files /dev/null and b/ext/standard/tests/image/bug72278.jpg differ diff --git a/ext/standard/tests/image/bug72278.phpt b/ext/standard/tests/image/bug72278.phpt new file mode 100644 index 0000000000000..1ee194681f6f6 --- /dev/null +++ b/ext/standard/tests/image/bug72278.phpt @@ -0,0 +1,33 @@ +--TEST-- +Bug #72278 (getimagesize returning FALSE on valid jpg) +--SKIPIF-- + +--FILE-- + +===DONE=== +--EXPECTF-- + +Warning: getimagesize(): corrupt JPEG data: 3 extraneous bytes before marker in %s%ebug72278.php on line %d +array(7) { + [0]=> + int(300) + [1]=> + int(300) + [2]=> + int(2) + [3]=> + string(24) "width="300" height="300"" + ["bits"]=> + int(8) + ["channels"]=> + int(3) + ["mime"]=> + string(10) "image/jpeg" +} +===DONE=== diff --git a/ext/standard/tests/misc/bug65550.phpt b/ext/standard/tests/misc/bug65550.phpt new file mode 100644 index 0000000000000..41967426fa303 --- /dev/null +++ b/ext/standard/tests/misc/bug65550.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #65550 (get_browser() incorrectly parses entries with "+" sign) +--INI-- +browscap={PWD}/browscap.ini +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECT-- +string(7) "OmniWeb" +string(3) "5.6" +==DONE== diff --git a/ext/standard/tests/serialize/bug69152.phpt b/ext/standard/tests/serialize/bug69152.phpt index bc2b302ddb75d..4e741685ccd04 100644 --- a/ext/standard/tests/serialize/bug69152.phpt +++ b/ext/standard/tests/serialize/bug69152.phpt @@ -9,7 +9,6 @@ $x->test(); ?> --EXPECTF-- -Notice: Undefined property: Exception::$previous in %s on line %d exception 'Exception' in %s:%d Stack trace: #0 {main} diff --git a/ext/standard/tests/serialize/bug69793.phpt b/ext/standard/tests/serialize/bug69793.phpt index 624f1ac740103..b5784b89eb359 100644 --- a/ext/standard/tests/serialize/bug69793.phpt +++ b/ext/standard/tests/serialize/bug69793.phpt @@ -7,8 +7,6 @@ $e = unserialize('O:9:"Exception":7:{s:17:"'."\0".'Exception'."\0".'string";s:1: var_dump($e.""); ?> --EXPECTF-- -Notice: Undefined property: Exception::$message in %s%ebug69793.php on line %d - Notice: Undefined property: Exception::$file in %s%ebug69793.php on line %d Notice: Undefined property: Exception::$previous in %s%ebug69793.php on line %d diff --git a/ext/standard/tests/streams/bug72771.phpt b/ext/standard/tests/streams/bug72771.phpt new file mode 100644 index 0000000000000..b38ccbdda8260 --- /dev/null +++ b/ext/standard/tests/streams/bug72771.phpt @@ -0,0 +1,23 @@ +--TEST-- +Bug #72771. FTPS to FTP downgrade not allowed when server doesn't support AUTH TLS or AUTH SSL. +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECTF-- +Warning: opendir(ftps://127.0.0.1:%d/): failed to open dir: Server doesn't support FTPS. in %s on line %d +bool(false) +==DONE== diff --git a/ext/standard/tests/streams/bug72853.phpt b/ext/standard/tests/streams/bug72853.phpt new file mode 100644 index 0000000000000..48bd60e7a6293 --- /dev/null +++ b/ext/standard/tests/streams/bug72853.phpt @@ -0,0 +1,59 @@ +--TEST-- +Bug #72853 (stream_set_blocking doesn't work) +--SKIPIF-- + +--FILE-- + array('pipe', 'r'), // stdin + 1 => array('pipe', 'w'), // stdout +); + +$p = proc_open("ls", $descs, $pipes, '.', NULL, NULL); + +stream_set_blocking($pipes[1], false); +var_dump(stream_get_meta_data($pipes[1])); +stream_set_blocking($pipes[1], true); +while ($outs = fgets($pipes[1], 1024)) { +} +var_dump(stream_get_meta_data($pipes[1])); +proc_close($p); +?> +--EXPECTF-- +array(7) { + ["timed_out"]=> + bool(false) + ["blocked"]=> + bool(false) + ["eof"]=> + bool(false) + ["stream_type"]=> + string(5) "STDIO" + ["mode"]=> + string(1) "r" + ["unread_bytes"]=> + int(0) + ["seekable"]=> + bool(false) +} +array(7) { + ["timed_out"]=> + bool(false) + ["blocked"]=> + bool(true) + ["eof"]=> + bool(true) + ["stream_type"]=> + string(5) "STDIO" + ["mode"]=> + string(1) "r" + ["unread_bytes"]=> + int(0) + ["seekable"]=> + bool(false) +} diff --git a/ext/standard/tests/streams/opendir-001.phpt b/ext/standard/tests/streams/opendir-001.phpt new file mode 100644 index 0000000000000..28fa43cf2683e --- /dev/null +++ b/ext/standard/tests/streams/opendir-001.phpt @@ -0,0 +1,22 @@ +--TEST-- +opendir() with 'ftp://' stream. +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECTF-- +Warning: opendir(ftp://localhost:%d/bogusdir): failed to open dir: FTP server reports 250 /bogusdir: No such file or directory + in %s on line %d +bool(false) +==DONE== diff --git a/ext/standard/tests/streams/opendir-002.phpt b/ext/standard/tests/streams/opendir-002.phpt new file mode 100644 index 0000000000000..83d40e8bb1f4a --- /dev/null +++ b/ext/standard/tests/streams/opendir-002.phpt @@ -0,0 +1,31 @@ +--TEST-- +opendir() with 'ftp://' stream. +--SKIPIF-- + +--FILE-- + +==DONE== +--EXPECTF-- +resource(%d) of type (stream) +string(5) "file1" +string(5) "file1" +string(3) "fil" +string(4) "b0rk" +==DONE== diff --git a/ext/standard/tests/streams/opendir-003.phpt b/ext/standard/tests/streams/opendir-003.phpt new file mode 100644 index 0000000000000..1d6a9057fa8d2 --- /dev/null +++ b/ext/standard/tests/streams/opendir-003.phpt @@ -0,0 +1,26 @@ +--TEST-- +opendir() with 'ftps://' stream. +--SKIPIF-- + +--FILE-- + array('cafile' => __DIR__ . '/../../../ftp/tests/cert.pem'))); + +var_dump(opendir($path, $context)); +?> +==DONE== +--EXPECTF-- +Warning: opendir(ftps://127.0.0.1:%d/bogusdir): failed to open dir: FTP server reports 250 /bogusdir: No such file or directory + in %s on line %d +bool(false) +==DONE== diff --git a/ext/standard/tests/streams/opendir-004.phpt b/ext/standard/tests/streams/opendir-004.phpt new file mode 100644 index 0000000000000..b50c6580c2d82 --- /dev/null +++ b/ext/standard/tests/streams/opendir-004.phpt @@ -0,0 +1,32 @@ +--TEST-- +opendir() with 'ftps://' stream. +--SKIPIF-- + +--FILE-- + array('cafile' => __DIR__ . '/../../../ftp/tests/cert.pem'))); + +$ds=opendir($path, $context); +var_dump($ds); +while ($fn=readdir($ds)) { + var_dump($fn); +} +?> +==DONE== +--EXPECTF-- +resource(%d) of type (stream) +string(5) "file1" +string(5) "file1" +string(3) "fil" +string(4) "b0rk" +==DONE== diff --git a/ext/standard/tests/streams/stream_socket_enable_crypto-win32.phpt b/ext/standard/tests/streams/stream_socket_enable_crypto-win32.phpt index 237b4ed6a5678..919fda8e5c2a8 100644 --- a/ext/standard/tests/streams/stream_socket_enable_crypto-win32.phpt +++ b/ext/standard/tests/streams/stream_socket_enable_crypto-win32.phpt @@ -5,7 +5,7 @@ marcosptf - - #phparty7 - @phpsp - novatec/2015 - sao p --SKIPIF-- data); + } + + function unserialize($data) + { + $this->data = unserialize($data); + } +} + +$fakezval = ptr2str(1122334455); +$fakezval .= ptr2str(0); +$fakezval .= "\x00\x00\x00\x00"; +$fakezval .= "\x01"; +$fakezval .= "\x00"; +$fakezval .= "\x00\x00"; + +$inner = 'C:3:"obj":3:{ryat'; +$exploit = 'a:4:{i:0;i:1;i:1;C:3:"obj":'.strlen($inner).':{'.$inner.'}i:2;s:'.strlen($fakezval).':"'.$fakezval.'";i:3;R:5;}'; + +$data = unserialize($exploit); + +var_dump($data); + +function ptr2str($ptr) +{ + $out = ''; + + for ($i = 0; $i < 8; $i++) { + $out .= chr($ptr & 0xff); + $ptr >>= 8; + } + + return $out; +} +?> +DONE +--EXPECTF-- +Notice: unserialize(): Error at offset 0 of 3 bytes in %sbug70436.php on line %d + +Notice: unserialize(): Error at offset 17 of 17 bytes in %sbug70436.php on line %d +array(4) { + [0]=> + int(1) + [1]=> + object(obj)#%d (1) { + ["data"]=> + bool(false) + } + [2]=> + string(24) "%s" + [3]=> + bool(false) +} +DONE \ No newline at end of file diff --git a/ext/standard/tests/strings/bug72663.phpt b/ext/standard/tests/strings/bug72663.phpt new file mode 100644 index 0000000000000..e61f939d4dbef --- /dev/null +++ b/ext/standard/tests/strings/bug72663.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #72663: Create an Unexpected Object and Don't Invoke __wakeup() in Deserialization +--FILE-- +data); + } + function unserialize($data) { + $this->data = unserialize($data); + } +} + +$inner = 'a:1:{i:0;O:9:"Exception":2:{s:7:"'."\0".'*'."\0".'file";R:4;}'; +$exploit = 'a:2:{i:0;C:3:"obj":'.strlen($inner).':{'.$inner.'}i:1;R:4;}'; + +$data = unserialize($exploit); +echo $data[1]; +?> +DONE +--EXPECTF-- +Notice: unserialize(): Unexpected end of serialized data in %sbug72663.php on line %d + +Notice: unserialize(): Error at offset 46 of 47 bytes in %sbug72663.php on line %d +DONE \ No newline at end of file diff --git a/ext/standard/tests/strings/bug72663_2.phpt b/ext/standard/tests/strings/bug72663_2.phpt new file mode 100644 index 0000000000000..ac605e9fd2647 --- /dev/null +++ b/ext/standard/tests/strings/bug72663_2.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #72663: Create an Unexpected Object and Don't Invoke __wakeup() in Deserialization +--FILE-- + +DONE +--EXPECTF-- +Notice: session_decode(): Unexpected end of serialized data in %sbug72663_2.php on line %d +array(0) { +} +DONE \ No newline at end of file diff --git a/ext/standard/tests/strings/bug72663_3.phpt b/ext/standard/tests/strings/bug72663_3.phpt new file mode 100644 index 0000000000000..f7d66efd178b6 --- /dev/null +++ b/ext/standard/tests/strings/bug72663_3.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #72663: Create an Unexpected Object and Don't Invoke __wakeup() in Deserialization +--XFAIL-- +Memory leak, TBF later. +--FILE-- +ryat = str_repeat('A', 0x112); + } +} + +$poc = 'O:8:"stdClass":1:{i:0;O:3:"obj":1:{s:4:"ryat";R:1;'; +unserialize($poc); +?> +DONE +--EXPECTF-- +Notice: unserialize(): Error at offset 51 of 50 bytes in %sbug72663_3.php on line %d +DONE diff --git a/ext/standard/tests/strings/bug72703.phpt b/ext/standard/tests/strings/bug72703.phpt new file mode 100644 index 0000000000000..5e3bf4875d964 --- /dev/null +++ b/ext/standard/tests/strings/bug72703.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #72703 Out of bounds global memory read in BF_crypt triggered by password_verify +--SKIPIF-- + +--FILE-- + +==OK== +--EXPECT-- +bool(false) +==OK== + diff --git a/ext/standard/tests/strings/bug72823.phpt b/ext/standard/tests/strings/bug72823.phpt new file mode 100644 index 0000000000000..d0aaf0fd35d75 --- /dev/null +++ b/ext/standard/tests/strings/bug72823.phpt @@ -0,0 +1,12 @@ +--TEST-- +Bug #72823 (strtr out-of-bound access) +--FILE-- + 'bbb')) +); +?> +===DONE=== +--EXPECT-- +string(2) "11" +===DONE=== diff --git a/ext/standard/url.c b/ext/standard/url.c index 4b52000f645cf..dd861a570d8c0 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -520,6 +520,13 @@ PHPAPI char *php_url_encode(char const *s, int len, int *new_length) *to++ = c; } } + + if ((to-start) > INT_MAX) { + TSRMLS_FETCH(); + /* E_ERROR since most clients won't check for error, and this is rather rare condition */ + php_error_docref(NULL TSRMLS_CC, E_ERROR, "String overflow, max length is %d", INT_MAX); + } + *to = 0; if (new_length) { *new_length = to - start; diff --git a/ext/standard/url_scanner_ex.c b/ext/standard/url_scanner_ex.c index 6b5a2bf19f3f3..20f82c24a6bee 100644 --- a/ext/standard/url_scanner_ex.c +++ b/ext/standard/url_scanner_ex.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 */ +/* Generated by re2c 0.14.3 */ #line 1 "ext/standard/url_scanner_ex.re" /* +----------------------------------------------------------------------+ @@ -104,17 +104,43 @@ PHP_INI_END() #define YYLIMIT q #define YYMARKER r -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator) +static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator TSRMLS_DC) { register const char *p, *q; const char *bash = NULL; const char *sep = "?"; - + + /* + * Don't modify "//example.com" full path, unless + * HTTP_HOST matches. + */ + if (url->c[0] == '/' && url->c[1] == '/') { + zval **tmp, **http_host; + size_t target_len, host_len; + if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **)&tmp) == FAILURE + || Z_TYPE_PP(tmp) != IS_ARRAY + || zend_hash_find(Z_ARRVAL_PP(tmp), "HTTP_HOST", sizeof("HTTP_HOST"), (void **)&http_host) == FAILURE + || Z_TYPE_PP(http_host) != IS_STRING) { + smart_str_append(dest, url); + return; + } + /* HTTP_HOST could be "example.com:8888", etc. */ + /* Need to find end of URL in buffer */ + host_len = strcspn(Z_STRVAL_PP(http_host), ":"); + target_len = strcspn(url->c+2, "/\"'?>\r\n"); + if (host_len + && host_len == target_len + && strncasecmp(Z_STRVAL_PP(http_host), url->c+2, host_len)) { + smart_str_append(dest, url); + return; + } + } + q = (p = url->c) + url->len; scan: -#line 118 "ext/standard/url_scanner_ex.c" +#line 144 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -157,22 +183,22 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st if (yybm[0+yych] & 128) { goto yy8; } - if (yych <= '9') goto yy6; + if (yych <= '#') goto yy6; if (yych >= ';') goto yy4; ++YYCURSOR; -#line 120 "ext/standard/url_scanner_ex.re" +#line 146 "ext/standard/url_scanner_ex.re" { smart_str_append(dest, url); return; } -#line 166 "ext/standard/url_scanner_ex.c" +#line 192 "ext/standard/url_scanner_ex.c" yy4: ++YYCURSOR; -#line 121 "ext/standard/url_scanner_ex.re" +#line 147 "ext/standard/url_scanner_ex.re" { sep = separator; goto scan; } -#line 171 "ext/standard/url_scanner_ex.c" +#line 197 "ext/standard/url_scanner_ex.c" yy6: ++YYCURSOR; -#line 122 "ext/standard/url_scanner_ex.re" +#line 148 "ext/standard/url_scanner_ex.re" { bash = p - 1; goto done; } -#line 176 "ext/standard/url_scanner_ex.c" +#line 202 "ext/standard/url_scanner_ex.c" yy8: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -180,11 +206,11 @@ static inline void append_modified_url(smart_str *url, smart_str *dest, smart_st if (yybm[0+yych] & 128) { goto yy8; } -#line 123 "ext/standard/url_scanner_ex.re" +#line 149 "ext/standard/url_scanner_ex.re" { goto scan; } -#line 186 "ext/standard/url_scanner_ex.c" +#line 212 "ext/standard/url_scanner_ex.c" } -#line 124 "ext/standard/url_scanner_ex.re" +#line 150 "ext/standard/url_scanner_ex.re" done: @@ -223,7 +249,7 @@ static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSR if (quotes) smart_str_appendc(&ctx->result, type); if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output); + append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output TSRMLS_CC); } else { smart_str_append(&ctx->result, &ctx->val); } @@ -364,7 +390,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s state_plain: start = YYCURSOR; -#line 368 "ext/standard/url_scanner_ex.c" +#line 394 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -407,9 +433,9 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s goto yy15; } ++YYCURSOR; -#line 303 "ext/standard/url_scanner_ex.re" +#line 329 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_TAG; goto state_tag; } -#line 413 "ext/standard/url_scanner_ex.c" +#line 439 "ext/standard/url_scanner_ex.c" yy15: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -417,17 +443,17 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s if (yybm[0+yych] & 128) { goto yy15; } -#line 304 "ext/standard/url_scanner_ex.re" +#line 330 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain; } -#line 423 "ext/standard/url_scanner_ex.c" +#line 449 "ext/standard/url_scanner_ex.c" } -#line 305 "ext/standard/url_scanner_ex.re" +#line 331 "ext/standard/url_scanner_ex.re" state_tag: start = YYCURSOR; -#line 431 "ext/standard/url_scanner_ex.c" +#line 457 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -478,14 +504,14 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s yych = *YYCURSOR; goto yy25; yy21: -#line 310 "ext/standard/url_scanner_ex.re" +#line 336 "ext/standard/url_scanner_ex.re" { handle_tag(STD_ARGS); /* Sets STATE */; passthru(STD_ARGS); if (STATE == STATE_PLAIN) goto state_plain; else goto state_next_arg; } -#line 484 "ext/standard/url_scanner_ex.c" +#line 510 "ext/standard/url_scanner_ex.c" yy22: ++YYCURSOR; -#line 311 "ext/standard/url_scanner_ex.re" +#line 337 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain_begin; } -#line 489 "ext/standard/url_scanner_ex.c" +#line 515 "ext/standard/url_scanner_ex.c" yy24: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -496,7 +522,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s } goto yy21; } -#line 312 "ext/standard/url_scanner_ex.re" +#line 338 "ext/standard/url_scanner_ex.re" state_next_arg_begin: @@ -505,7 +531,7 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s state_next_arg: start = YYCURSOR; -#line 509 "ext/standard/url_scanner_ex.c" +#line 535 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -570,28 +596,28 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s ++YYCURSOR; if ((yych = *YYCURSOR) == '>') goto yy39; yy29: -#line 323 "ext/standard/url_scanner_ex.re" +#line 349 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_plain_begin; } -#line 576 "ext/standard/url_scanner_ex.c" +#line 602 "ext/standard/url_scanner_ex.c" yy30: ++YYCURSOR; yy31: -#line 320 "ext/standard/url_scanner_ex.re" +#line 346 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); handle_form(STD_ARGS); goto state_plain_begin; } -#line 582 "ext/standard/url_scanner_ex.c" +#line 608 "ext/standard/url_scanner_ex.c" yy32: ++YYCURSOR; yych = *YYCURSOR; goto yy38; yy33: -#line 321 "ext/standard/url_scanner_ex.re" +#line 347 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_next_arg; } -#line 590 "ext/standard/url_scanner_ex.c" +#line 616 "ext/standard/url_scanner_ex.c" yy34: ++YYCURSOR; -#line 322 "ext/standard/url_scanner_ex.re" +#line 348 "ext/standard/url_scanner_ex.re" { --YYCURSOR; STATE = STATE_ARG; goto state_arg; } -#line 595 "ext/standard/url_scanner_ex.c" +#line 621 "ext/standard/url_scanner_ex.c" yy36: yych = *++YYCURSOR; goto yy29; @@ -609,13 +635,13 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s yych = *YYCURSOR; goto yy31; } -#line 324 "ext/standard/url_scanner_ex.re" +#line 350 "ext/standard/url_scanner_ex.re" state_arg: start = YYCURSOR; -#line 619 "ext/standard/url_scanner_ex.c" +#line 645 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -663,14 +689,14 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s yych = *YYCURSOR; goto yy47; yy43: -#line 329 "ext/standard/url_scanner_ex.re" +#line 355 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); handle_arg(STD_ARGS); STATE = STATE_BEFORE_VAL; goto state_before_val; } -#line 669 "ext/standard/url_scanner_ex.c" +#line 695 "ext/standard/url_scanner_ex.c" yy44: ++YYCURSOR; -#line 330 "ext/standard/url_scanner_ex.re" +#line 356 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_NEXT_ARG; goto state_next_arg; } -#line 674 "ext/standard/url_scanner_ex.c" +#line 700 "ext/standard/url_scanner_ex.c" yy46: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -681,13 +707,13 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s } goto yy43; } -#line 331 "ext/standard/url_scanner_ex.re" +#line 357 "ext/standard/url_scanner_ex.re" state_before_val: start = YYCURSOR; -#line 691 "ext/standard/url_scanner_ex.c" +#line 717 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -734,17 +760,17 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s if (yych == ' ') goto yy57; if (yych == '=') goto yy55; yy51: -#line 337 "ext/standard/url_scanner_ex.re" +#line 363 "ext/standard/url_scanner_ex.re" { --YYCURSOR; goto state_next_arg_begin; } -#line 740 "ext/standard/url_scanner_ex.c" +#line 766 "ext/standard/url_scanner_ex.c" yy52: ++YYCURSOR; yych = *YYCURSOR; goto yy56; yy53: -#line 336 "ext/standard/url_scanner_ex.re" +#line 362 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); STATE = STATE_VAL; goto state_val; } -#line 748 "ext/standard/url_scanner_ex.c" +#line 774 "ext/standard/url_scanner_ex.c" yy54: yych = *++YYCURSOR; goto yy51; @@ -766,14 +792,14 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s YYCURSOR = YYMARKER; goto yy51; } -#line 338 "ext/standard/url_scanner_ex.re" +#line 364 "ext/standard/url_scanner_ex.re" state_val: start = YYCURSOR; -#line 777 "ext/standard/url_scanner_ex.c" +#line 803 "ext/standard/url_scanner_ex.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -834,9 +860,9 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s yych = *(YYMARKER = ++YYCURSOR); if (yych != '>') goto yy76; yy63: -#line 347 "ext/standard/url_scanner_ex.re" +#line 373 "ext/standard/url_scanner_ex.re" { passthru(STD_ARGS); goto state_next_arg_begin; } -#line 840 "ext/standard/url_scanner_ex.c" +#line 866 "ext/standard/url_scanner_ex.c" yy64: yych = *(YYMARKER = ++YYCURSOR); if (yych == '>') goto yy63; @@ -846,9 +872,9 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s yych = *YYCURSOR; goto yy69; yy66: -#line 346 "ext/standard/url_scanner_ex.re" +#line 372 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 0, ' '); goto state_next_arg_begin; } -#line 852 "ext/standard/url_scanner_ex.c" +#line 878 "ext/standard/url_scanner_ex.c" yy67: yych = *++YYCURSOR; goto yy63; @@ -869,15 +895,15 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s if (yybm[0+yych] & 64) { goto yy70; } - if (yych <= '=') goto yy73; + if (yych <= '\'') goto yy73; yy72: YYCURSOR = YYMARKER; goto yy63; yy73: ++YYCURSOR; -#line 345 "ext/standard/url_scanner_ex.re" +#line 371 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 1, '\''); goto state_next_arg_begin; } -#line 881 "ext/standard/url_scanner_ex.c" +#line 907 "ext/standard/url_scanner_ex.c" yy75: ++YYCURSOR; if (YYLIMIT <= YYCURSOR) YYFILL(1); @@ -886,13 +912,13 @@ static inline void xx_mainloop(url_adapt_state_ex_t *ctx, const char *newdata, s if (yybm[0+yych] & 128) { goto yy75; } - if (yych >= '>') goto yy72; + if (yych >= '#') goto yy72; ++YYCURSOR; -#line 344 "ext/standard/url_scanner_ex.re" +#line 370 "ext/standard/url_scanner_ex.re" { handle_val(STD_ARGS, 1, '"'); goto state_next_arg_begin; } -#line 894 "ext/standard/url_scanner_ex.c" +#line 920 "ext/standard/url_scanner_ex.c" } -#line 348 "ext/standard/url_scanner_ex.re" +#line 374 "ext/standard/url_scanner_ex.re" stop: @@ -917,7 +943,7 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha smart_str_appendc(&url_app, '='); smart_str_appends(&url_app, value); - append_modified_url(&surl, &buf, &url_app, PG(arg_separator).output); + append_modified_url(&surl, &buf, &url_app, PG(arg_separator).output TSRMLS_CC); smart_str_0(&buf); if (newlen) *newlen = buf.len; diff --git a/ext/standard/url_scanner_ex.re b/ext/standard/url_scanner_ex.re index 851e025ca1bf0..5ee7063c19efa 100644 --- a/ext/standard/url_scanner_ex.re +++ b/ext/standard/url_scanner_ex.re @@ -107,12 +107,38 @@ alphadash = ([a-zA-Z] | "-"); #define YYLIMIT q #define YYMARKER r -static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator) +static inline void append_modified_url(smart_str *url, smart_str *dest, smart_str *url_app, const char *separator TSRMLS_DC) { register const char *p, *q; const char *bash = NULL; const char *sep = "?"; - + + /* + * Don't modify "//example.com" full path, unless + * HTTP_HOST matches. + */ + if (url->c[0] == '/' && url->c[1] == '/') { + zval **tmp, **http_host; + size_t target_len, host_len; + if (zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **)&tmp) == FAILURE + || Z_TYPE_PP(tmp) != IS_ARRAY + || zend_hash_find(Z_ARRVAL_PP(tmp), "HTTP_HOST", sizeof("HTTP_HOST"), (void **)&http_host) == FAILURE + || Z_TYPE_PP(http_host) != IS_STRING) { + smart_str_append(dest, url); + return; + } + /* HTTP_HOST could be "example.com:8888", etc. */ + /* Need to find end of URL in buffer */ + host_len = strcspn(Z_STRVAL_PP(http_host), ":"); + target_len = strcspn(url->c+2, "/\"'?>\r\n"); + if (host_len + && host_len == target_len + && strncasecmp(Z_STRVAL_PP(http_host), url->c+2, host_len)) { + smart_str_append(dest, url); + return; + } + } + q = (p = url->c) + url->len; scan: @@ -159,7 +185,7 @@ static inline void tag_arg(url_adapt_state_ex_t *ctx, char quotes, char type TSR if (quotes) smart_str_appendc(&ctx->result, type); if (f) { - append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output); + append_modified_url(&ctx->val, &ctx->result, &ctx->url_app, PG(arg_separator).output TSRMLS_CC); } else { smart_str_append(&ctx->result, &ctx->val); } @@ -369,7 +395,7 @@ char *php_url_scanner_adapt_single_url(const char *url, size_t urllen, const cha smart_str_appendc(&url_app, '='); smart_str_appends(&url_app, value); - append_modified_url(&surl, &buf, &url_app, PG(arg_separator).output); + append_modified_url(&surl, &buf, &url_app, PG(arg_separator).output TSRMLS_CC); smart_str_0(&buf); if (newlen) *newlen = buf.len; diff --git a/ext/standard/uuencode.c b/ext/standard/uuencode.c index cd35c288ee87b..a31f14d82452c 100644 --- a/ext/standard/uuencode.c +++ b/ext/standard/uuencode.c @@ -153,7 +153,7 @@ PHPAPI int php_uudecode(char *src, int src_len, char **dest) /* {{{ */ while (s < ee) { if(s+4 > e) { goto err; - } + } *p++ = PHP_UU_DEC(*s) << 2 | PHP_UU_DEC(*(s + 1)) >> 4; *p++ = PHP_UU_DEC(*(s + 1)) << 4 | PHP_UU_DEC(*(s + 2)) >> 2; *p++ = PHP_UU_DEC(*(s + 2)) << 6 | PHP_UU_DEC(*(s + 3)); @@ -188,7 +188,7 @@ PHPAPI int php_uudecode(char *src, int src_len, char **dest) /* {{{ */ } /* }}} */ -/* {{{ proto string convert_uuencode(string data) +/* {{{ proto string convert_uuencode(string data) uuencode a string */ PHP_FUNCTION(convert_uuencode) { @@ -200,6 +200,11 @@ PHP_FUNCTION(convert_uuencode) } dst_len = php_uuencode(src, src_len, &dst); + if (dst_len < 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "String too long, max length is %d", INT_MAX); + efree(dst); + RETURN_FALSE; + } RETURN_STRINGL(dst, dst_len, 0); } diff --git a/ext/standard/var.c b/ext/standard/var.c index f0efef2f93ca8..137e794fb1921 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -962,6 +962,7 @@ PHP_FUNCTION(unserialize) p = (const unsigned char*) buf; PHP_VAR_UNSERIALIZE_INIT(var_hash); if (!php_var_unserialize(&return_value, &p, p + buf_len, &var_hash TSRMLS_CC)) { + var_push_dtor(&var_hash, &return_value); PHP_VAR_UNSERIALIZE_DESTROY(var_hash); zval_dtor(return_value); if (!EG(exception)) { diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c index 1e45b03fcc644..c8e6f8a0ca9aa 100644 --- a/ext/standard/var_unserializer.c +++ b/ext/standard/var_unserializer.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 */ +/* Generated by re2c 0.13.7.5 */ #line 1 "ext/standard/var_unserializer.re" /* +----------------------------------------------------------------------+ @@ -408,7 +408,7 @@ static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) elements = parse_iv2((*p) + 2, p); (*p) += 2; - + if (ce->serialize == NULL) { object_init_ex(*rval, ce); } else { @@ -434,9 +434,18 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, long elements) } if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements, 1)) { + /* We've got partially constructed object on our hands here. Wipe it. */ + if(Z_TYPE_PP(rval) == IS_OBJECT) { + zend_hash_clean(Z_OBJPROP_PP(rval)); + } + ZVAL_NULL(*rval); return 0; } + if (Z_TYPE_PP(rval) != IS_OBJECT) { + return 0; + } + if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY && zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))) { INIT_PZVAL(&fname); @@ -482,7 +491,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) -#line 486 "ext/standard/var_unserializer.c" +#line 495 "ext/standard/var_unserializer.c" { YYCTYPE yych; static const unsigned char yybm[] = { @@ -542,9 +551,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *(YYMARKER = ++YYCURSOR); if (yych == ':') goto yy95; yy3: -#line 851 "ext/standard/var_unserializer.re" +#line 860 "ext/standard/var_unserializer.re" { return 0; } -#line 548 "ext/standard/var_unserializer.c" +#line 557 "ext/standard/var_unserializer.c" yy4: yych = *(YYMARKER = ++YYCURSOR); if (yych == ':') goto yy89; @@ -587,13 +596,13 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) goto yy3; yy14: ++YYCURSOR; -#line 845 "ext/standard/var_unserializer.re" +#line 854 "ext/standard/var_unserializer.re" { /* this is the case where we have less data than planned */ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data"); return 0; /* not sure if it should be 0 or 1 here? */ } -#line 597 "ext/standard/var_unserializer.c" +#line 606 "ext/standard/var_unserializer.c" yy16: yych = *++YYCURSOR; goto yy3; @@ -619,11 +628,12 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) if (yybm[0+yych] & 128) { goto yy20; } - if (yych != ':') goto yy18; + if (yych <= '/') goto yy18; + if (yych >= ';') goto yy18; yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; -#line 698 "ext/standard/var_unserializer.re" +#line 707 "ext/standard/var_unserializer.re" { size_t len, len2, len3, maxlen; long elements; @@ -770,7 +780,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return object_common2(UNSERIALIZE_PASSTHRU, elements); } -#line 774 "ext/standard/var_unserializer.c" +#line 784 "ext/standard/var_unserializer.c" yy25: yych = *++YYCURSOR; if (yych <= ',') { @@ -795,7 +805,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; -#line 689 "ext/standard/var_unserializer.re" +#line 698 "ext/standard/var_unserializer.re" { if (!var_hash) return 0; @@ -804,7 +814,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return object_common2(UNSERIALIZE_PASSTHRU, object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR)); } -#line 808 "ext/standard/var_unserializer.c" +#line 818 "ext/standard/var_unserializer.c" yy32: yych = *++YYCURSOR; if (yych == '+') goto yy33; @@ -825,7 +835,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != '{') goto yy18; ++YYCURSOR; -#line 668 "ext/standard/var_unserializer.re" +#line 677 "ext/standard/var_unserializer.re" { long elements = parse_iv(start + 2); /* use iv() not uiv() in order to check data range */ @@ -846,7 +856,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return finish_nested_data(UNSERIALIZE_PASSTHRU); } -#line 850 "ext/standard/var_unserializer.c" +#line 860 "ext/standard/var_unserializer.c" yy39: yych = *++YYCURSOR; if (yych == '+') goto yy40; @@ -867,7 +877,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; -#line 633 "ext/standard/var_unserializer.re" +#line 642 "ext/standard/var_unserializer.re" { size_t len, maxlen; char *str; @@ -902,7 +912,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) ZVAL_STRINGL(*rval, str, len, 0); return 1; } -#line 906 "ext/standard/var_unserializer.c" +#line 916 "ext/standard/var_unserializer.c" yy46: yych = *++YYCURSOR; if (yych == '+') goto yy47; @@ -923,7 +933,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != '"') goto yy18; ++YYCURSOR; -#line 600 "ext/standard/var_unserializer.re" +#line 609 "ext/standard/var_unserializer.re" { size_t len, maxlen; char *str; @@ -956,7 +966,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) ZVAL_STRINGL(*rval, str, len, 1); return 1; } -#line 960 "ext/standard/var_unserializer.c" +#line 970 "ext/standard/var_unserializer.c" yy53: yych = *++YYCURSOR; if (yych <= '/') { @@ -1044,7 +1054,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) } yy63: ++YYCURSOR; -#line 590 "ext/standard/var_unserializer.re" +#line 599 "ext/standard/var_unserializer.re" { #if SIZEOF_LONG == 4 use_double: @@ -1054,7 +1064,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL)); return 1; } -#line 1058 "ext/standard/var_unserializer.c" +#line 1068 "ext/standard/var_unserializer.c" yy65: yych = *++YYCURSOR; if (yych <= ',') { @@ -1113,7 +1123,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != ';') goto yy18; ++YYCURSOR; -#line 575 "ext/standard/var_unserializer.re" +#line 584 "ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); @@ -1128,7 +1138,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return 1; } -#line 1132 "ext/standard/var_unserializer.c" +#line 1142 "ext/standard/var_unserializer.c" yy76: yych = *++YYCURSOR; if (yych == 'N') goto yy73; @@ -1155,7 +1165,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) if (yych <= '9') goto yy79; if (yych != ';') goto yy18; ++YYCURSOR; -#line 548 "ext/standard/var_unserializer.re" +#line 557 "ext/standard/var_unserializer.re" { #if SIZEOF_LONG == 4 int digits = YYCURSOR - start - 3; @@ -1182,7 +1192,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) ZVAL_LONG(*rval, parse_iv(start + 2)); return 1; } -#line 1186 "ext/standard/var_unserializer.c" +#line 1196 "ext/standard/var_unserializer.c" yy83: yych = *++YYCURSOR; if (yych <= '/') goto yy18; @@ -1190,24 +1200,24 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) yych = *++YYCURSOR; if (yych != ';') goto yy18; ++YYCURSOR; -#line 541 "ext/standard/var_unserializer.re" +#line 550 "ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_BOOL(*rval, parse_iv(start + 2)); return 1; } -#line 1201 "ext/standard/var_unserializer.c" +#line 1211 "ext/standard/var_unserializer.c" yy87: ++YYCURSOR; -#line 534 "ext/standard/var_unserializer.re" +#line 543 "ext/standard/var_unserializer.re" { *p = YYCURSOR; INIT_PZVAL(*rval); ZVAL_NULL(*rval); return 1; } -#line 1211 "ext/standard/var_unserializer.c" +#line 1221 "ext/standard/var_unserializer.c" yy89: yych = *++YYCURSOR; if (yych <= ',') { @@ -1230,7 +1240,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) if (yych <= '9') goto yy91; if (yych != ';') goto yy18; ++YYCURSOR; -#line 511 "ext/standard/var_unserializer.re" +#line 520 "ext/standard/var_unserializer.re" { long id; @@ -1253,7 +1263,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return 1; } -#line 1257 "ext/standard/var_unserializer.c" +#line 1267 "ext/standard/var_unserializer.c" yy95: yych = *++YYCURSOR; if (yych <= ',') { @@ -1276,7 +1286,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) if (yych <= '9') goto yy97; if (yych != ';') goto yy18; ++YYCURSOR; -#line 490 "ext/standard/var_unserializer.re" +#line 499 "ext/standard/var_unserializer.re" { long id; @@ -1297,9 +1307,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER) return 1; } -#line 1301 "ext/standard/var_unserializer.c" +#line 1311 "ext/standard/var_unserializer.c" } -#line 853 "ext/standard/var_unserializer.re" +#line 862 "ext/standard/var_unserializer.re" return 0; diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re index d1d4ef98e4790..11b93c522b226 100644 --- a/ext/standard/var_unserializer.re +++ b/ext/standard/var_unserializer.re @@ -412,7 +412,7 @@ static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce) elements = parse_iv2((*p) + 2, p); (*p) += 2; - + if (ce->serialize == NULL) { object_init_ex(*rval, ce); } else { @@ -438,9 +438,18 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, long elements) } if (!process_nested_data(UNSERIALIZE_PASSTHRU, Z_OBJPROP_PP(rval), elements, 1)) { + /* We've got partially constructed object on our hands here. Wipe it. */ + if(Z_TYPE_PP(rval) == IS_OBJECT) { + zend_hash_clean(Z_OBJPROP_PP(rval)); + } + ZVAL_NULL(*rval); return 0; } + if (Z_TYPE_PP(rval) != IS_OBJECT) { + return 0; + } + if (Z_OBJCE_PP(rval) != PHP_IC_ENTRY && zend_hash_exists(&Z_OBJCE_PP(rval)->function_table, "__wakeup", sizeof("__wakeup"))) { INIT_PZVAL(&fname); diff --git a/ext/wddx/tests/bug72142.phpt b/ext/wddx/tests/bug72142.phpt new file mode 100644 index 0000000000000..3976bb2554f0d --- /dev/null +++ b/ext/wddx/tests/bug72142.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #72142: WDDX Packet Injection Vulnerability in wddx_serialize_value() +--FILE-- +stdClass'); +var_dump($wddx); +var_dump(wddx_deserialize($wddx)); + +?> +--EXPECT-- +string(301) "
</comment></header><data><struct><var name="php_class_name"><string>stdClass</string></var></struct></data></wddxPacket>
" +string(0) "" diff --git a/ext/wddx/tests/bug72564.phpt b/ext/wddx/tests/bug72564.phpt new file mode 100644 index 0000000000000..4711ef8b40a4c --- /dev/null +++ b/ext/wddx/tests/bug72564.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #72564: wddx deserialization of boolean +--SKIPIF-- + +--FILE-- + +Done +--EXPECT-- +string(84) "
" +bool(true) +string(85) "
" +bool(false) +string(68) "
" +NULL +Done diff --git a/ext/wddx/tests/bug72749.phpt b/ext/wddx/tests/bug72749.phpt new file mode 100644 index 0000000000000..ee17d0f229567 --- /dev/null +++ b/ext/wddx/tests/bug72749.phpt @@ -0,0 +1,34 @@ +--TEST-- +Bug #72749: wddx_deserialize allows illegal memory access +--SKIPIF-- + +--FILE-- + + + +
+ + + + 2\r2004-09-10T05:52:49+00 + + + + +XML; + +$array = wddx_deserialize($xml); +var_dump($array); +?> +--EXPECT-- +array(1) { + ["aDateTime3"]=> + string(24) "2 +2004-09-10T05:52:49+00" +} diff --git a/ext/wddx/tests/bug72750.phpt b/ext/wddx/tests/bug72750.phpt new file mode 100644 index 0000000000000..3a6794df2803f --- /dev/null +++ b/ext/wddx/tests/bug72750.phpt @@ -0,0 +1,34 @@ +--TEST-- +Bug #72750: wddx_deserialize null dereference +--SKIPIF-- + +--FILE-- + + + +
+ + + + \\tYmluYXJRhdGE= + + + + +XML; + +$array = wddx_deserialize($xml); +var_dump($array); +?> +--EXPECT-- +array(1) { + ["aBinary"]=> + string(0) "" +} diff --git a/ext/wddx/tests/bug72790.phpt b/ext/wddx/tests/bug72790.phpt new file mode 100644 index 0000000000000..a60524bdaf19e --- /dev/null +++ b/ext/wddx/tests/bug72790.phpt @@ -0,0 +1,35 @@ +--TEST-- +Bug 72790: wddx_deserialize null dereference with invalid xml +--SKIPIF-- + +--FILE-- + + + + |array> + + + + + + + + + + + + +XML; + +$array = wddx_deserialize($xml); +var_dump($array); +?> +--EXPECT-- +NULL \ No newline at end of file diff --git a/ext/wddx/tests/bug72799.phpt b/ext/wddx/tests/bug72799.phpt new file mode 100644 index 0000000000000..5861d5538f49f --- /dev/null +++ b/ext/wddx/tests/bug72799.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #72799: wddx_deserialize null dereference in php_wddx_pop_element +--SKIPIF-- + +--FILE-- + + + + + + 1998-06-12T04:32:12+00 + + + +XML; + +$array = wddx_deserialize($xml); +var_dump($array); +?> +--EXPECT-- +NULL \ No newline at end of file diff --git a/ext/wddx/wddx.c b/ext/wddx/wddx.c index 6a23fa1c1ef1a..d7bd295832c70 100644 --- a/ext/wddx/wddx.c +++ b/ext/wddx/wddx.c @@ -371,11 +371,19 @@ void php_wddx_packet_start(wddx_packet *packet, char *comment, int comment_len) { php_wddx_add_chunk_static(packet, WDDX_PACKET_S); if (comment) { + char *escaped; + size_t escaped_len; + TSRMLS_FETCH(); + escaped = php_escape_html_entities( + comment, comment_len, &escaped_len, 0, ENT_QUOTES, NULL TSRMLS_CC); + php_wddx_add_chunk_static(packet, WDDX_HEADER_S); php_wddx_add_chunk_static(packet, WDDX_COMMENT_S); - php_wddx_add_chunk_ex(packet, comment, comment_len); + php_wddx_add_chunk_ex(packet, escaped, escaped_len); php_wddx_add_chunk_static(packet, WDDX_COMMENT_E); php_wddx_add_chunk_static(packet, WDDX_HEADER_E); + + str_efree(escaped); } else { php_wddx_add_chunk_static(packet, WDDX_HEADER); } @@ -938,10 +946,10 @@ static void php_wddx_pop_element(void *user_data, const XML_Char *name) if (!ent1->data) { if (stack->top > 1) { stack->top--; + efree(ent1); } else { stack->done = 1; } - efree(ent1); return; } @@ -951,8 +959,12 @@ static void php_wddx_pop_element(void *user_data, const XML_Char *name) new_str = php_base64_decode(Z_STRVAL_P(ent1->data), Z_STRLEN_P(ent1->data), &new_len); STR_FREE(Z_STRVAL_P(ent1->data)); - Z_STRVAL_P(ent1->data) = new_str; - Z_STRLEN_P(ent1->data) = new_len; + if (new_str) { + Z_STRVAL_P(ent1->data) = new_str; + Z_STRLEN_P(ent1->data) = new_len; + } else { + ZVAL_EMPTY_STRING(ent1->data); + } } /* Call __wakeup() method on the object. */ @@ -976,7 +988,7 @@ static void php_wddx_pop_element(void *user_data, const XML_Char *name) wddx_stack_top(stack, (void**)&ent2); /* if non-existent field */ - if (ent2->type == ST_FIELD && ent2->data == NULL) { + if (ent2->data == NULL) { zval_ptr_dtor(&ent1->data); efree(ent1); return; @@ -1115,18 +1127,26 @@ static void php_wddx_process_data(void *user_data, const XML_Char *s, int len) case ST_DATETIME: { char *tmp; - tmp = emalloc(len + 1); - memcpy(tmp, s, len); + if (Z_TYPE_P(ent->data) == IS_STRING) { + tmp = safe_emalloc(Z_STRLEN_P(ent->data), 1, (size_t)len + 1); + memcpy(tmp, Z_STRVAL_P(ent->data), Z_STRLEN_P(ent->data)); + memcpy(tmp + Z_STRLEN_P(ent->data), s, len); + len += Z_STRLEN_P(ent->data); + efree(Z_STRVAL_P(ent->data)); + Z_TYPE_P(ent->data) = IS_LONG; + } else { + tmp = emalloc(len + 1); + memcpy(tmp, s, len); + } tmp[len] = '\0'; Z_LVAL_P(ent->data) = php_parse_date(tmp, NULL); /* date out of range < 1969 or > 2038 */ if (Z_LVAL_P(ent->data) == -1) { - Z_TYPE_P(ent->data) = IS_STRING; - Z_STRLEN_P(ent->data) = len; - Z_STRVAL_P(ent->data) = estrndup(s, len); + ZVAL_STRINGL(ent->data, tmp, len, 0); + } else { + efree(tmp); } - efree(tmp); } break; @@ -1159,9 +1179,13 @@ int php_wddx_deserialize_ex(char *value, int vallen, zval *return_value) if (stack.top == 1) { wddx_stack_top(&stack, (void**)&ent); - *return_value = *(ent->data); - zval_copy_ctor(return_value); - retval = SUCCESS; + if(ent->data == NULL) { + retval = FAILURE; + } else { + *return_value = *(ent->data); + zval_copy_ctor(return_value); + retval = SUCCESS; + } } else { retval = FAILURE; } diff --git a/ext/xml/tests/bug72085.phpt b/ext/xml/tests/bug72085.phpt new file mode 100644 index 0000000000000..2989289cb1c38 --- /dev/null +++ b/ext/xml/tests/bug72085.phpt @@ -0,0 +1,74 @@ +--TEST-- +Bug #72085 (SEGV on unknown address zif_xml_parse) +--SKIPIF-- + +--FILE-- +", 10)); +?> +===DONE=== +--EXPECTF-- +Warning: Invalid callback exception 'Exception' in %s%ebug72085.php:%d +Stack trace: +#0 {main}, no array or string given in %s%ebug72085.php on line %d + +Warning: xml_parse(): Unable to call handler in %s%ebug72085.php on line %d + +Warning: Invalid callback exception 'Exception' in %s%ebug72085.php:%d +Stack trace: +#0 {main}, no array or string given in %s%ebug72085.php on line %d + +Warning: xml_parse(): Unable to call handler in %s%ebug72085.php on line %d + +Warning: Invalid callback exception 'Exception' in %s%ebug72085.php:%d +Stack trace: +#0 {main}, no array or string given in %s%ebug72085.php on line %d + +Warning: xml_parse(): Unable to call handler in %s%ebug72085.php on line %d + +Warning: Invalid callback exception 'Exception' in %s%ebug72085.php:%d +Stack trace: +#0 {main}, no array or string given in %s%ebug72085.php on line %d + +Warning: xml_parse(): Unable to call handler in %s%ebug72085.php on line %d + +Warning: Invalid callback exception 'Exception' in %s%ebug72085.php:%d +Stack trace: +#0 {main}, no array or string given in %s%ebug72085.php on line %d + +Warning: xml_parse(): Unable to call handler in %s%ebug72085.php on line %d + +Warning: Invalid callback exception 'Exception' in %s%ebug72085.php:%d +Stack trace: +#0 {main}, no array or string given in %s%ebug72085.php on line %d + +Warning: xml_parse(): Unable to call handler in %s%ebug72085.php on line %d + +Warning: Invalid callback exception 'Exception' in %s%ebug72085.php:%d +Stack trace: +#0 {main}, no array or string given in %s%ebug72085.php on line %d + +Warning: xml_parse(): Unable to call handler in %s%ebug72085.php on line %d + +Warning: Invalid callback exception 'Exception' in %s%ebug72085.php:%d +Stack trace: +#0 {main}, no array or string given in %s%ebug72085.php on line %d + +Warning: xml_parse(): Unable to call handler in %s%ebug72085.php on line %d + +Warning: Invalid callback exception 'Exception' in %s%ebug72085.php:%d +Stack trace: +#0 {main}, no array or string given in %s%ebug72085.php on line %d + +Warning: xml_parse(): Unable to call handler in %s%ebug72085.php on line %d + +Warning: Invalid callback exception 'Exception' in %s%ebug72085.php:%d +Stack trace: +#0 {main}, no array or string given in %s%ebug72085.php on line %d + +Warning: xml_parse(): Unable to call handler in %s%ebug72085.php on line %d +===DONE=== diff --git a/ext/xml/tests/bug72714.phpt b/ext/xml/tests/bug72714.phpt new file mode 100644 index 0000000000000..7b44e1fd117e6 --- /dev/null +++ b/ext/xml/tests/bug72714.phpt @@ -0,0 +1,35 @@ +--TEST-- +Bug #72714 (_xml_startElementHandler() segmentation fault) +--SKIPIF-- + +--FILE-- +867'; + + $xml_parser = xml_parser_create(); + xml_set_element_handler($xml_parser, 'startElement', 'endElement'); + + xml_parser_set_option($xml_parser, XML_OPTION_SKIP_TAGSTART, $tagstart); + xml_parse($xml_parser, $xml); + + xml_parser_free($xml_parser); +} + +parse(3015809298423721); +parse(20); +?> +===DONE=== +--EXPECTF-- +Notice: xml_parser_set_option(): tagstart ignored, because it is out of range in %s%ebug72714.php on line %d +string(9) "NS1:TOTAL" +string(0) "" +===DONE=== diff --git a/ext/xml/xml.c b/ext/xml/xml.c index 0850f0c605d28..5912f9143ddda 100644 --- a/ext/xml/xml.c +++ b/ext/xml/xml.c @@ -66,6 +66,10 @@ ZEND_GET_MODULE(xml) #endif /* COMPILE_DL_XML */ /* }}} */ + +#define SKIP_TAGSTART(str) ((str) + (parser->toffset > strlen(str) ? strlen(str) : parser->toffset)) + + /* {{{ function prototypes */ PHP_MINIT_FUNCTION(xml); PHP_MINFO_FUNCTION(xml); @@ -535,7 +539,8 @@ static zval *xml_call_handler(xml_parser *parser, zval *handler, zend_function * if (Z_TYPE_P(handler) == IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call handler %s()", Z_STRVAL_P(handler)); - } else if (zend_hash_index_find(Z_ARRVAL_P(handler), 0, (void **) &obj) == SUCCESS && + } else if (Z_TYPE_P(handler) == IS_ARRAY && + zend_hash_index_find(Z_ARRVAL_P(handler), 0, (void **) &obj) == SUCCESS && zend_hash_index_find(Z_ARRVAL_P(handler), 1, (void **) &method) == SUCCESS && Z_TYPE_PP(obj) == IS_OBJECT && Z_TYPE_PP(method) == IS_STRING) { @@ -784,7 +789,7 @@ void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Ch if (parser->startElementHandler) { args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_string_zval(((char *) tag_name) + parser->toffset); + args[1] = _xml_string_zval(SKIP_TAGSTART((char *) tag_name)); MAKE_STD_ZVAL(args[2]); array_init(args[2]); @@ -815,9 +820,9 @@ void _xml_startElementHandler(void *userData, const XML_Char *name, const XML_Ch array_init(tag); array_init(atr); - _xml_add_to_info(parser,((char *) tag_name) + parser->toffset); + _xml_add_to_info(parser,SKIP_TAGSTART((char *) tag_name)); - add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */ + add_assoc_string(tag,"tag",SKIP_TAGSTART((char *) tag_name),1); add_assoc_string(tag,"type","open",1); add_assoc_long(tag,"level",parser->level); @@ -869,7 +874,7 @@ void _xml_endElementHandler(void *userData, const XML_Char *name) if (parser->endElementHandler) { args[0] = _xml_resource_zval(parser->index); - args[1] = _xml_string_zval(((char *) tag_name) + parser->toffset); + args[1] = _xml_string_zval(SKIP_TAGSTART((char *) tag_name)); if ((retval = xml_call_handler(parser, parser->endElementHandler, parser->endElementPtr, 2, args))) { zval_ptr_dtor(&retval); @@ -886,9 +891,9 @@ void _xml_endElementHandler(void *userData, const XML_Char *name) array_init(tag); - _xml_add_to_info(parser,((char *) tag_name) + parser->toffset); + _xml_add_to_info(parser,SKIP_TAGSTART((char *) tag_name)); - add_assoc_string(tag,"tag",((char *) tag_name) + parser->toffset,1); /* cast to avoid gcc-warning */ + add_assoc_string(tag,"tag",SKIP_TAGSTART((char *) tag_name),1); add_assoc_string(tag,"type","close",1); add_assoc_long(tag,"level",parser->level); @@ -989,9 +994,9 @@ void _xml_characterDataHandler(void *userData, const XML_Char *s, int len) array_init(tag); - _xml_add_to_info(parser,parser->ltags[parser->level-1] + parser->toffset); + _xml_add_to_info(parser,SKIP_TAGSTART(parser->ltags[parser->level-1])); - add_assoc_string(tag,"tag",parser->ltags[parser->level-1] + parser->toffset,1); + add_assoc_string(tag,"tag",SKIP_TAGSTART(parser->ltags[parser->level-1]),1); add_assoc_string(tag,"value",decoded_value,0); add_assoc_string(tag,"type","cdata",1); add_assoc_long(tag,"level",parser->level); @@ -1632,6 +1637,10 @@ PHP_FUNCTION(xml_parser_set_option) case PHP_XML_OPTION_SKIP_TAGSTART: convert_to_long_ex(val); parser->toffset = Z_LVAL_PP(val); + if (parser->toffset < 0) { + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "tagstart ignored, because it is out of range"); + parser->toffset = 0; + } break; case PHP_XML_OPTION_SKIP_WHITE: convert_to_long_ex(val); diff --git a/ext/xmlrpc/libxmlrpc/simplestring.c b/ext/xmlrpc/libxmlrpc/simplestring.c index a084d0e64f347..c88754fb9ae18 100644 --- a/ext/xmlrpc/libxmlrpc/simplestring.c +++ b/ext/xmlrpc/libxmlrpc/simplestring.c @@ -5,28 +5,28 @@ Epinions.com may be contacted at feedback@epinions-inc.com */ -/* - Copyright 2000 Epinions, Inc. +/* + Copyright 2000 Epinions, Inc. - Subject to the following 3 conditions, Epinions, Inc. permits you, free - of charge, to (a) use, copy, distribute, modify, perform and display this - software and associated documentation files (the "Software"), and (b) - permit others to whom the Software is furnished to do so as well. + Subject to the following 3 conditions, Epinions, Inc. permits you, free + of charge, to (a) use, copy, distribute, modify, perform and display this + software and associated documentation files (the "Software"), and (b) + permit others to whom the Software is furnished to do so as well. - 1) The above copyright notice and this permission notice shall be included - without modification in all copies or substantial portions of the - Software. + 1) The above copyright notice and this permission notice shall be included + without modification in all copies or substantial portions of the + Software. - 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF - ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY - IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR - PURPOSE OR NONINFRINGEMENT. + 2) THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTY OR CONDITION OF + ANY KIND, EXPRESS, IMPLIED OR STATUTORY, INCLUDING WITHOUT LIMITATION ANY + IMPLIED WARRANTIES OF ACCURACY, MERCHANTABILITY, FITNESS FOR A PARTICULAR + PURPOSE OR NONINFRINGEMENT. - 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, - SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT - OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING - NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH - DAMAGES. + 3) IN NO EVENT SHALL EPINIONS, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, + SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES OR LOST PROFITS ARISING OUT + OF OR IN CONNECTION WITH THE SOFTWARE (HOWEVER ARISING, INCLUDING + NEGLIGENCE), EVEN IF EPINIONS, INC. IS AWARE OF THE POSSIBILITY OF SUCH + DAMAGES. */ @@ -71,7 +71,7 @@ static const char rcsid[] = "#(@) $Id$"; * * Oh, and it is also binary safe, ie it can handle strings with embedded NULLs, * so long as the real length is passed in. - * + * * And the masses rejoiced. * * BUGS @@ -136,7 +136,7 @@ static void simplestring_init_str(simplestring* string) { * NOTES * This function is very fast as it does not de-allocate any memory. * SEE ALSO - * + * * SOURCE */ void simplestring_clear(simplestring* string) { @@ -172,6 +172,9 @@ void simplestring_free(simplestring* string) { } /******/ +#ifndef SIZE_MAX +#define SIZE_MAX ((size_t)-1) +#endif /****f* FUNC/simplestring_addn * NAME * simplestring_addn @@ -190,18 +193,31 @@ void simplestring_free(simplestring* string) { * simplestring_add () * SOURCE */ -void simplestring_addn(simplestring* target, const char* source, int add_len) { +void simplestring_addn(simplestring* target, const char* source, size_t add_len) { + size_t newsize = target->size, incr = 0; if(target && source) { if(!target->str) { simplestring_init_str(target); } + + if((SIZE_MAX - add_len) < target->len || (SIZE_MAX - add_len - 1) < target->len) { + /* check for overflows, if there's a potential overflow do nothing */ + return; + } + if(target->len + add_len + 1 > target->size) { /* newsize is current length + new length */ - int newsize = target->len + add_len + 1; - int incr = target->size * 2; + newsize = target->len + add_len + 1; + incr = target->size * 2; /* align to SIMPLESTRING_INCR increments */ - newsize = newsize - (newsize % incr) + incr; + if (incr) { + newsize = newsize - (newsize % incr) + incr; + } + if(newsize < (target->len + add_len + 1)) { + /* some kind of overflow happened */ + return; + } target->str = (char*)realloc(target->str, newsize); target->size = target->str ? newsize : 0; diff --git a/ext/xmlrpc/libxmlrpc/simplestring.h b/ext/xmlrpc/libxmlrpc/simplestring.h index c5d98cf1d8e01..7e88cd0ef04a1 100644 --- a/ext/xmlrpc/libxmlrpc/simplestring.h +++ b/ext/xmlrpc/libxmlrpc/simplestring.h @@ -63,7 +63,7 @@ void simplestring_init(simplestring* string); void simplestring_clear(simplestring* string); void simplestring_free(simplestring* string); void simplestring_add(simplestring* string, const char* add); -void simplestring_addn(simplestring* string, const char* add, int add_len); +void simplestring_addn(simplestring* string, const char* add, size_t add_len); #ifdef __cplusplus } diff --git a/ext/zip/config.m4 b/ext/zip/config.m4 index a21ad2d3e12e6..845d446055960 100644 --- a/ext/zip/config.m4 +++ b/ext/zip/config.m4 @@ -148,6 +148,9 @@ AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long]) AC_CHECK_SIZEOF([long long]) AC_CHECK_SIZEOF([off_t]) +if test "$ac_cv_sizeof_off_t" = "0" ; then + AC_MSG_ERROR(off_t undefined; check your library configuration) +fi AC_CHECK_SIZEOF([size_t]) AC_PATH_PROG([TOUCH], [touch]) diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index 1cd134ecfb498..a0a34757a38c9 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -116,13 +116,13 @@ static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_D { struct zip_stat sb; const char *path = stream->orig_path; - int path_len = strlen(stream->orig_path); + size_t path_len = strlen(stream->orig_path); char *file_basename; size_t file_basename_len; char file_dirname[MAXPATHLEN]; struct zip *za; char *fragment; - int fragment_len; + size_t fragment_len; int err; fragment = strchr(path, '#'); @@ -229,7 +229,7 @@ php_stream *php_stream_zip_open(const char *filename, const char *path, const ch self = emalloc(sizeof(*self)); self->za = stream_za; - self->zf = zf; + self->zf = zf; self->stream = NULL; self->cursor = 0; stream = php_stream_alloc(&php_stream_zipio_ops, self, NULL, mode); @@ -256,7 +256,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC) { - int path_len; + size_t path_len; char *file_basename; size_t file_basename_len; @@ -265,7 +265,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, struct zip *za; struct zip_file *zf = NULL; char *fragment; - int fragment_len; + size_t fragment_len; int err; php_stream *stream = NULL; @@ -308,7 +308,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper, self = emalloc(sizeof(*self)); self->za = za; - self->zf = zf; + self->zf = zf; self->stream = NULL; self->cursor = 0; stream = php_stream_alloc(&php_stream_zipio_ops, self, NULL, mode); diff --git a/main/SAPI.c b/main/SAPI.c index eebf1f0757df1..49ffc1c9a4282 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -1,4 +1,4 @@ -/* +/* +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ @@ -128,7 +128,7 @@ PHP_FUNCTION(header_register_callback) if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &callback_func) == FAILURE) { return; } - + if (!zend_is_callable(callback_func, 0, &callback_name TSRMLS_CC)) { efree(callback_name); RETURN_FALSE; @@ -156,10 +156,10 @@ static void sapi_run_header_callback(TSRMLS_D) char *callback_name = NULL; char *callback_error = NULL; zval *retval_ptr = NULL; - + if (zend_fcall_info_init(SG(callback_func), 0, &fci, &SG(fci_cache), &callback_name, &callback_error TSRMLS_CC) == SUCCESS) { fci.retval_ptr_ptr = &retval_ptr; - + error = zend_call_function(&fci, &SG(fci_cache) TSRMLS_CC); if (error == FAILURE) { goto callback_failed; @@ -170,13 +170,13 @@ static void sapi_run_header_callback(TSRMLS_D) callback_failed: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not call the sapi_header_callback"); } - + if (callback_name) { efree(callback_name); } if (callback_error) { efree(callback_error); - } + } } SAPI_API void sapi_handle_post(void *arg TSRMLS_DC) @@ -407,11 +407,11 @@ SAPI_API void sapi_activate_headers_only(TSRMLS_D) if (SG(request_info).headers_read == 1) return; SG(request_info).headers_read = 1; - zend_llist_init(&SG(sapi_headers).headers, sizeof(sapi_header_struct), + zend_llist_init(&SG(sapi_headers).headers, sizeof(sapi_header_struct), (void (*)(void *)) sapi_free_header, 0); SG(sapi_headers).send_default_content_type = 1; - /* SG(sapi_headers).http_response_code = 200; */ + /* SG(sapi_headers).http_response_code = 200; */ SG(sapi_headers).http_status_line = NULL; SG(sapi_headers).mimetype = NULL; SG(read_post_bytes) = 0; @@ -423,7 +423,7 @@ SAPI_API void sapi_activate_headers_only(TSRMLS_D) SG(global_request_time) = 0; /* - * It's possible to override this general case in the activate() callback, + * It's possible to override this general case in the activate() callback, * if necessary. */ if (SG(request_info).request_method && !strcmp(SG(request_info).request_method, "HEAD")) { @@ -509,7 +509,7 @@ static void sapi_send_headers_free(TSRMLS_D) SG(sapi_headers).http_status_line = NULL; } } - + SAPI_API void sapi_deactivate(TSRMLS_D) { zend_llist_destroy(&SG(sapi_headers).headers); @@ -583,7 +583,7 @@ static int sapi_extract_response_code(const char *header_line) break; } } - + return code; } @@ -603,7 +603,7 @@ static void sapi_update_response_code(int ncode TSRMLS_DC) SG(sapi_headers).http_response_code = ncode; } -/* +/* * since zend_llist_del_element only remove one matched item once, * we should remove them by ourself */ @@ -639,7 +639,7 @@ SAPI_API int sapi_add_header_ex(char *header_line, uint header_line_len, zend_bo { sapi_header_line ctr = {0}; int r; - + ctr.line = header_line; ctr.line_len = header_line_len; @@ -733,7 +733,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) } while(header_line_len && isspace(header_line[header_line_len-1])); header_line[header_line_len]='\0'; } - + if (op == SAPI_HEADER_DELETE) { if (strchr(header_line, ':')) { efree(header_line); @@ -771,7 +771,7 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) sapi_header.header_len = header_line_len; /* Check the header for a few cases that we have special support for in SAPI */ - if (header_line_len>=5 + if (header_line_len>=5 && !strncasecmp(header_line, "HTTP/", 5)) { /* filter out the response code */ sapi_update_response_code(sapi_extract_response_code(header_line) TSRMLS_CC); @@ -830,8 +830,8 @@ SAPI_API int sapi_header_op(sapi_header_op_enum op, void *arg TSRMLS_DC) /* Return a Found Redirect if one is not already specified */ if (http_response_code) { /* user specified redirect code */ sapi_update_response_code(http_response_code TSRMLS_CC); - } else if (SG(request_info).proto_num > 1000 && - SG(request_info).request_method && + } else if (SG(request_info).proto_num > 1000 && + SG(request_info).request_method && strcmp(SG(request_info).request_method, "HEAD") && strcmp(SG(request_info).request_method, "GET")) { sapi_update_response_code(303 TSRMLS_CC); @@ -1020,7 +1020,11 @@ SAPI_API struct stat *sapi_get_stat(TSRMLS_D) SAPI_API char *sapi_getenv(char *name, size_t name_len TSRMLS_DC) { - if (sapi_module.getenv) { + if (!strncasecmp(name, "HTTP_PROXY", name_len)) { + /* Ugly fix for HTTP_PROXY issue, see bug #72573 */ + return NULL; + } + if (sapi_module.getenv) { char *value, *tmp = sapi_module.getenv(name, name_len TSRMLS_CC); if (tmp) { value = estrdup(tmp); diff --git a/main/php_variables.c b/main/php_variables.c index 58f1c7c945228..018e906582422 100644 --- a/main/php_variables.c +++ b/main/php_variables.c @@ -47,7 +47,7 @@ PHPAPI void php_register_variable_safe(char *var, char *strval, int str_len, zva { zval new_entry; assert(strval != NULL); - + /* Prepare value */ Z_STRLEN(new_entry) = str_len; Z_STRVAL(new_entry) = estrndup(strval, Z_STRLEN(new_entry)); @@ -85,7 +85,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars while (*var_name && *var_name==' ') { var_name++; } - + /* * Prepare variable name */ @@ -171,7 +171,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars return; } *ip = 0; - new_idx_len = strlen(index_s); + new_idx_len = strlen(index_s); } if (!index) { @@ -214,7 +214,7 @@ PHPAPI void php_register_variable_ex(char *var_name, zval *val, zval *track_vars zval_ptr_dtor(&gpc_element); } } else { - /* + /* * According to rfc2965, more specific paths are listed above the less specific ones. * If we encounter a duplicate cookie name, we should skip it, since it is not possible * to have the same (plain text) cookie name for the same path and we should not overwrite @@ -367,7 +367,7 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data) int free_buffer = 0; char *strtok_buf = NULL; long count = 0; - + switch (arg) { case PARSE_POST: case PARSE_GET: @@ -440,9 +440,9 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data) separator = ";\0"; break; } - + var = php_strtok_r(res, separator, &strtok_buf); - + while (var) { val = strchr(var, '='); @@ -537,11 +537,11 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC) zval *arr, *argc, *tmp; int count = 0; char *ss, *space; - + if (!(SG(request_info).argc || track_vars_array)) { return; } - + ALLOC_INIT_ZVAL(arr); array_init(arr); @@ -602,7 +602,7 @@ static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC) Z_ADDREF_P(argc); zend_hash_update(&EG(symbol_table), "argv", sizeof("argv"), &arr, sizeof(zval *), NULL); zend_hash_update(&EG(symbol_table), "argc", sizeof("argc"), &argc, sizeof(zval *), NULL); - } + } if (track_vars_array) { Z_ADDREF_P(arr); Z_ADDREF_P(argc); @@ -732,7 +732,7 @@ static zend_bool php_auto_globals_create_get(const char *name, uint name_len TSR zend_hash_update(&EG(symbol_table), name, name_len + 1, &vars, sizeof(zval *), NULL); Z_ADDREF_P(vars); - + return 0; /* don't rearm */ } @@ -758,7 +758,7 @@ static zend_bool php_auto_globals_create_post(const char *name, uint name_len TS zend_hash_update(&EG(symbol_table), name, name_len + 1, &vars, sizeof(zval *), NULL); Z_ADDREF_P(vars); - + return 0; /* don't rearm */ } @@ -781,7 +781,7 @@ static zend_bool php_auto_globals_create_cookie(const char *name, uint name_len zend_hash_update(&EG(symbol_table), name, name_len + 1, &vars, sizeof(zval *), NULL); Z_ADDREF_P(vars); - + return 0; /* don't rearm */ } @@ -800,10 +800,27 @@ static zend_bool php_auto_globals_create_files(const char *name, uint name_len T zend_hash_update(&EG(symbol_table), name, name_len + 1, &vars, sizeof(zval *), NULL); Z_ADDREF_P(vars); - + return 0; /* don't rearm */ } +/* Upgly hack to fix HTTP_PROXY issue, see bug #72573 */ +static void check_http_proxy(HashTable *var_table) +{ + if (zend_hash_exists(var_table, "HTTP_PROXY", sizeof("HTTP_PROXY"))) { + char *local_proxy = getenv("HTTP_PROXY"); + + if (!local_proxy) { + zend_hash_del(var_table, "HTTP_PROXY", sizeof("HTTP_PROXY")); + } else { + zval *local_zval; + ALLOC_INIT_ZVAL(local_zval); + ZVAL_STRING(local_zval, local_proxy, 1); + zend_hash_update(var_table, "HTTP_PROXY", sizeof("HTTP_PROXY"), &local_zval, sizeof(zval **), NULL); + } + } +} + static zend_bool php_auto_globals_create_server(const char *name, uint name_len TSRMLS_DC) { if (PG(variables_order) && (strchr(PG(variables_order),'S') || strchr(PG(variables_order),'s'))) { @@ -812,7 +829,7 @@ static zend_bool php_auto_globals_create_server(const char *name, uint name_len if (PG(register_argc_argv)) { if (SG(request_info).argc) { zval **argc, **argv; - + if (zend_hash_find(&EG(symbol_table), "argc", sizeof("argc"), (void**)&argc) == SUCCESS && zend_hash_find(&EG(symbol_table), "argv", sizeof("argv"), (void**)&argv) == SUCCESS) { Z_ADDREF_PP(argc); @@ -824,7 +841,7 @@ static zend_bool php_auto_globals_create_server(const char *name, uint name_len php_build_argv(SG(request_info).query_string, PG(http_globals)[TRACK_VARS_SERVER] TSRMLS_CC); } } - + } else { zval *server_vars=NULL; ALLOC_ZVAL(server_vars); @@ -836,9 +853,10 @@ static zend_bool php_auto_globals_create_server(const char *name, uint name_len PG(http_globals)[TRACK_VARS_SERVER] = server_vars; } + check_http_proxy(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER])); zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_SERVER], sizeof(zval *), NULL); Z_ADDREF_P(PG(http_globals)[TRACK_VARS_SERVER]); - + return 0; /* don't rearm */ } @@ -852,11 +870,12 @@ static zend_bool php_auto_globals_create_env(const char *name, uint name_len TSR zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_ENV]); } PG(http_globals)[TRACK_VARS_ENV] = env_vars; - + if (PG(variables_order) && (strchr(PG(variables_order),'E') || strchr(PG(variables_order),'e'))) { php_import_environment_variables(PG(http_globals)[TRACK_VARS_ENV] TSRMLS_CC); } + check_http_proxy(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_ENV])); zend_hash_update(&EG(symbol_table), name, name_len + 1, &PG(http_globals)[TRACK_VARS_ENV], sizeof(zval *), NULL); Z_ADDREF_P(PG(http_globals)[TRACK_VARS_ENV]); diff --git a/main/php_version.h b/main/php_version.h index 2f8f634febb3e..8fa4040c5e2c6 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 6 -#define PHP_RELEASE_VERSION 24 -#define PHP_EXTRA_VERSION "RC1" -#define PHP_VERSION "5.6.24RC1" -#define PHP_VERSION_ID 50624 +#define PHP_RELEASE_VERSION 26 +#define PHP_EXTRA_VERSION "-dev" +#define PHP_VERSION "5.6.26-dev" +#define PHP_VERSION_ID 50626 diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c index 55f744c55de88..f472bad4b9e98 100644 --- a/main/streams/plain_wrapper.c +++ b/main/streams/plain_wrapper.c @@ -818,7 +818,19 @@ static int php_stdiop_set_option(php_stream *stream, int option, int value, void return ftruncate(fd, new_size) == 0 ? PHP_STREAM_OPTION_RETURN_OK : PHP_STREAM_OPTION_RETURN_ERR; } } - + case PHP_STREAM_OPTION_META_DATA_API: + if (fd == -1) + return -1; +#ifdef O_NONBLOCK + flags = fcntl(fd, F_GETFL, 0); + + add_assoc_bool((zval*)ptrparam, "timed_out", 0); + add_assoc_bool((zval*)ptrparam, "blocked", (flags & O_NONBLOCK)? 0 : 1); + add_assoc_bool((zval*)ptrparam, "eof", stream->eof); + + return PHP_STREAM_OPTION_RETURN_OK; +#endif + return -1; default: return PHP_STREAM_OPTION_RETURN_NOTIMPL; } diff --git a/main/streams/streams.c b/main/streams/streams.c index 30ea628d1a8a9..f8581336bd654 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1775,11 +1775,6 @@ PHPAPI php_stream_wrapper *php_stream_locate_url_wrapper(const char *path, const if ((*p == ':') && (n > 1) && (!strncmp("//", p+1, 2) || (n == 4 && !memcmp("data:", path, 5)))) { protocol = path; - } else if (n == 5 && strncasecmp(path, "zlib:", 5) == 0) { - /* BC with older php scripts and zlib wrapper */ - protocol = "compress.zlib"; - n = 13; - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Use of \"zlib:\" wrapper is deprecated; please use \"compress.zlib://\" instead"); } if (protocol) { diff --git a/php.ini-development b/php.ini-development index a9535e5951cfd..d38f672a59d23 100644 --- a/php.ini-development +++ b/php.ini-development @@ -690,7 +690,6 @@ default_charset = "UTF-8" ; PHP output character encoding is set to empty. ; If empty, default_charset is used. -; mbstring or iconv output handler is used. ; See also output_buffer. ; http://php.net/output-encoding ;output_encoding = diff --git a/php.ini-production b/php.ini-production index e3a9961af017c..d295c46392507 100644 --- a/php.ini-production +++ b/php.ini-production @@ -690,7 +690,6 @@ default_charset = "UTF-8" ; PHP output character encoding is set to empty. ; If empty, default_charset is used. -; mbstring or iconv output handler is used. ; See also output_buffer. ; http://php.net/output-encoding ;output_encoding = diff --git a/sapi/cli/generate_mime_type_map.php b/sapi/cli/generate_mime_type_map.php new file mode 100644 index 0000000000000..9e088814a04ed --- /dev/null +++ b/sapi/cli/generate_mime_type_map.php @@ -0,0 +1,76 @@ +#!/usr/bin/env php + 1 ? $_SERVER['argv'][1] : 'https://raw.githubusercontent.com/apache/httpd/trunk/docs/conf/mime.types'; + +// See if we can actually load it. +$types = @file($source); +if ($types === false) { + fprintf(STDERR, "Error: unable to read $source\n"); + exit(1); +} + +// Remove comments and flip into an extensions array. +$extensions = []; +array_walk($types, function ($line) use (&$extensions) { + $line = trim($line); + if ($line && $line[0] != '#') { + $fields = preg_split('/\s+/', $line); + if (count($fields) > 1) { + $mime = array_shift($fields); + foreach ($fields as $extension) { + $extensions[$extension] = $mime; + } + } + } +}); + +?> +/* + +----------------------------------------------------------------------+ + | PHP Version 7 | + +----------------------------------------------------------------------+ + | Copyright (c) 1997-2015 The PHP Group | + +----------------------------------------------------------------------+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is | + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | license@php.net so we can mail you a copy immediately. | + +----------------------------------------------------------------------+ + | Author: Moriyoshi Koizumi | + +----------------------------------------------------------------------+ +*/ + +/* This is a generated file. Rather than modifying it, please run + * "php generate_mime_type_map.php > mime_type_map.h" to regenerate the file. */ + +#ifndef PHP_CLI_SERVER_MIME_TYPE_MAP_H +#define PHP_CLI_SERVER_MIME_TYPE_MAP_H + +typedef struct php_cli_server_ext_mime_type_pair { + const char *ext; + const char *mime_type; +} php_cli_server_ext_mime_type_pair; + +static php_cli_server_ext_mime_type_pair mime_type_map[] = { + $mime): ?> + { "", "" }, + + { NULL, NULL } +}; + +#endif /* PHP_CLI_SERVER_MIME_TYPE_MAP_H */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim<600: noet sw=4 ts=4 + */ diff --git a/sapi/cli/tests/cli_process_title_unix.phpt b/sapi/cli/tests/cli_process_title_unix.phpt index c2632704c559e..659299c1fcfd6 100644 --- a/sapi/cli/tests/cli_process_title_unix.phpt +++ b/sapi/cli/tests/cli_process_title_unix.phpt @@ -15,7 +15,12 @@ $pid = getmypid(); if (cli_set_process_title($original_title) === true) echo "Successfully set title\n"; -$ps_output = shell_exec("ps -p $pid -o command | tail -n 1"); +$ps_process_title_field = "command"; +if (strtoupper(substr(PHP_OS, 0, 3)) == "AIX") +{ + $ps_process_title_field = "args"; +} +$ps_output = shell_exec("ps -p $pid -o $ps_process_title_field | tail -n 1"); if ($ps_output === null) { diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c index d812452e43c59..a4d28a64786c5 100644 --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c @@ -763,8 +763,8 @@ static int fpm_conf_process_all_pools() /* {{{ */ } } - /* alert if user is not set only if we are not root*/ - if (!wp->config->user && !geteuid()) { + /* alert if user is not set; only if we are root and fpm is not running with --allow-to-run-as-root */ + if (!wp->config->user && !geteuid() && !fpm_globals.run_as_root) { zlog(ZLOG_ALERT, "[pool %s] user has not been defined", wp->config->name); return -1; } diff --git a/sapi/fpm/fpm/fpm_scoreboard.c b/sapi/fpm/fpm/fpm_scoreboard.c index 8d0868182d763..7ddf1e84d9b9c 100644 --- a/sapi/fpm/fpm/fpm_scoreboard.c +++ b/sapi/fpm/fpm/fpm_scoreboard.c @@ -62,7 +62,6 @@ int fpm_scoreboard_init_main() /* {{{ */ if (!wp->scoreboard->procs[i]) { return -1; } - memset(wp->scoreboard->procs[i], 0, sizeof(struct fpm_scoreboard_proc_s)); } wp->scoreboard->pm = wp->config->pm; diff --git a/sapi/fpm/fpm/fpm_shm.c b/sapi/fpm/fpm/fpm_shm.c index 9226adf3d3f37..7986056793cf6 100644 --- a/sapi/fpm/fpm/fpm_shm.c +++ b/sapi/fpm/fpm/fpm_shm.c @@ -35,7 +35,6 @@ void *fpm_shm_alloc(size_t size) /* {{{ */ return NULL; } - memset(mem, 0, size); fpm_shm_size += size; return mem; } diff --git a/sapi/fpm/tests/022-cve-2016-5385.phpt b/sapi/fpm/tests/022-cve-2016-5385.phpt new file mode 100644 index 0000000000000..7f3e818f9b7df --- /dev/null +++ b/sapi/fpm/tests/022-cve-2016-5385.phpt @@ -0,0 +1,81 @@ +--TEST-- +FPM: HTTP_PROXY - CVE-2016-5385 +--SKIPIF-- + +--FILE-- + 'BAR', + 'HTTP_PROXY' => 'BADPROXY', + ]; + $req = run_request('127.0.0.1', $port, $srcfile, '', $headers); + echo strstr($req, "Test Start"); + echo "Request ok\n"; + } catch (Exception $e) { + echo "Request error\n"; + } + proc_terminate($fpm); + echo stream_get_contents($tail); + fclose($tail); + proc_close($fpm); +} + +?> +Done +--EXPECTF-- +[%s] NOTICE: fpm is running, pid %d +[%s] NOTICE: ready to handle connections +Test Start +NULL +string(3) "BAR" +bool(false) +string(3) "BAR" +Test End + +Request ok +[%s] NOTICE: Terminating ... +[%s] NOTICE: exiting, bye-bye! +Done +--CLEAN-- + diff --git a/sapi/fpm/tests/include.inc b/sapi/fpm/tests/include.inc index b195fad507325..a8b64f48b7eac 100644 --- a/sapi/fpm/tests/include.inc +++ b/sapi/fpm/tests/include.inc @@ -86,10 +86,10 @@ function fpm_display_log($tail, $n=1, $ignore='systemd') { } } -function run_request($host, $port, $uri='/ping', $query='') { +function run_request($host, $port, $uri='/ping', $query='', $headers=array()) { require_once 'fcgi.inc'; $client = new Adoy\FastCGI\Client($host, $port); - $params = array( + $params = array_merge(array( 'GATEWAY_INTERFACE' => 'FastCGI/1.0', 'REQUEST_METHOD' => 'GET', 'SCRIPT_FILENAME' => $uri, @@ -106,6 +106,6 @@ function run_request($host, $port, $uri='/ping', $query='') { 'SERVER_PROTOCOL' => 'HTTP/1.1', 'CONTENT_TYPE' => '', 'CONTENT_LENGTH' => 0 - ); + ), $headers); return $client->request($params, false)."\n"; } diff --git a/sapi/fpm/www.conf.in b/sapi/fpm/www.conf.in new file mode 100644 index 0000000000000..394e27819d935 --- /dev/null +++ b/sapi/fpm/www.conf.in @@ -0,0 +1,413 @@ +; Start a new pool named 'www'. +; the variable $pool can we used in any directive and will be replaced by the +; pool name ('www' here) +[www] + +; Per pool prefix +; It only applies on the following directives: +; - 'access.log' +; - 'slowlog' +; - 'listen' (unixsocket) +; - 'chroot' +; - 'chdir' +; - 'php_values' +; - 'php_admin_values' +; When not set, the global prefix (or @php_fpm_prefix@) applies instead. +; Note: This directive can also be relative to the global prefix. +; Default Value: none +;prefix = /path/to/pools/$pool + +; Unix user/group of processes +; Note: The user is mandatory. If the group is not set, the default user's group +; will be used. +user = @php_fpm_user@ +group = @php_fpm_group@ + +; The address on which to accept FastCGI requests. +; Valid syntaxes are: +; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific IPv4 address on +; a specific port; +; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on +; a specific port; +; 'port' - to listen on a TCP socket to all addresses +; (IPv6 and IPv4-mapped) on a specific port; +; '/path/to/unix/socket' - to listen on a unix socket. +; Note: This value is mandatory. +listen = 127.0.0.1:9000 + +; Set listen(2) backlog. +; Default Value: 511 (-1 on FreeBSD and OpenBSD) +;listen.backlog = 511 + +; Set permissions for unix socket, if one is used. In Linux, read/write +; permissions must be set in order to allow connections from a web server. Many +; BSD-derived systems allow connections regardless of permissions. +; Default Values: user and group are set as the running user +; mode is set to 0660 +;listen.owner = @php_fpm_user@ +;listen.group = @php_fpm_group@ +;listen.mode = 0660 +; When POSIX Access Control Lists are supported you can set them using +; these options, value is a comma separated list of user/group names. +; When set, listen.owner and listen.group are ignored +;listen.acl_users = +;listen.acl_groups = + +; List of addresses (IPv4/IPv6) of FastCGI clients which are allowed to connect. +; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original +; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address +; must be separated by a comma. If this value is left blank, connections will be +; accepted from any ip address. +; Default Value: any +;listen.allowed_clients = 127.0.0.1 + +; Specify the nice(2) priority to apply to the pool processes (only if set) +; The value can vary from -19 (highest priority) to 20 (lower priority) +; Note: - It will only work if the FPM master process is launched as root +; - The pool processes will inherit the master process priority +; unless it specified otherwise +; Default Value: no set +; process.priority = -19 + +; Choose how the process manager will control the number of child processes. +; Possible Values: +; static - a fixed number (pm.max_children) of child processes; +; dynamic - the number of child processes are set dynamically based on the +; following directives. With this process management, there will be +; always at least 1 children. +; pm.max_children - the maximum number of children that can +; be alive at the same time. +; pm.start_servers - the number of children created on startup. +; pm.min_spare_servers - the minimum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is less than this +; number then some children will be created. +; pm.max_spare_servers - the maximum number of children in 'idle' +; state (waiting to process). If the number +; of 'idle' processes is greater than this +; number then some children will be killed. +; ondemand - no children are created at startup. Children will be forked when +; new requests will connect. The following parameter are used: +; pm.max_children - the maximum number of children that +; can be alive at the same time. +; pm.process_idle_timeout - The number of seconds after which +; an idle process will be killed. +; Note: This value is mandatory. +pm = dynamic + +; The number of child processes to be created when pm is set to 'static' and the +; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'. +; This value sets the limit on the number of simultaneous requests that will be +; served. Equivalent to the ApacheMaxClients directive with mpm_prefork. +; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP +; CGI. The below defaults are based on a server without much resources. Don't +; forget to tweak pm.* to fit your needs. +; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand' +; Note: This value is mandatory. +pm.max_children = 5 + +; The number of child processes created on startup. +; Note: Used only when pm is set to 'dynamic' +; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2 +pm.start_servers = 2 + +; The desired minimum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.min_spare_servers = 1 + +; The desired maximum number of idle server processes. +; Note: Used only when pm is set to 'dynamic' +; Note: Mandatory when pm is set to 'dynamic' +pm.max_spare_servers = 3 + +; The number of seconds after which an idle process will be killed. +; Note: Used only when pm is set to 'ondemand' +; Default Value: 10s +;pm.process_idle_timeout = 10s; + +; The number of requests each child process should execute before respawning. +; This can be useful to work around memory leaks in 3rd party libraries. For +; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. +; Default Value: 0 +;pm.max_requests = 500 + +; The URI to view the FPM status page. If this value is not set, no URI will be +; recognized as a status page. It shows the following informations: +; pool - the name of the pool; +; process manager - static, dynamic or ondemand; +; start time - the date and time FPM has started; +; start since - number of seconds since FPM has started; +; accepted conn - the number of request accepted by the pool; +; listen queue - the number of request in the queue of pending +; connections (see backlog in listen(2)); +; max listen queue - the maximum number of requests in the queue +; of pending connections since FPM has started; +; listen queue len - the size of the socket queue of pending connections; +; idle processes - the number of idle processes; +; active processes - the number of active processes; +; total processes - the number of idle + active processes; +; max active processes - the maximum number of active processes since FPM +; has started; +; max children reached - number of times, the process limit has been reached, +; when pm tries to start more children (works only for +; pm 'dynamic' and 'ondemand'); +; Value are updated in real time. +; Example output: +; pool: www +; process manager: static +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 62636 +; accepted conn: 190460 +; listen queue: 0 +; max listen queue: 1 +; listen queue len: 42 +; idle processes: 4 +; active processes: 11 +; total processes: 15 +; max active processes: 12 +; max children reached: 0 +; +; By default the status page output is formatted as text/plain. Passing either +; 'html', 'xml' or 'json' in the query string will return the corresponding +; output syntax. Example: +; http://www.foo.bar/status +; http://www.foo.bar/status?json +; http://www.foo.bar/status?html +; http://www.foo.bar/status?xml +; +; By default the status page only outputs short status. Passing 'full' in the +; query string will also return status for each pool process. +; Example: +; http://www.foo.bar/status?full +; http://www.foo.bar/status?json&full +; http://www.foo.bar/status?html&full +; http://www.foo.bar/status?xml&full +; The Full status returns for each process: +; pid - the PID of the process; +; state - the state of the process (Idle, Running, ...); +; start time - the date and time the process has started; +; start since - the number of seconds since the process has started; +; requests - the number of requests the process has served; +; request duration - the duration in µs of the requests; +; request method - the request method (GET, POST, ...); +; request URI - the request URI with the query string; +; content length - the content length of the request (only with POST); +; user - the user (PHP_AUTH_USER) (or '-' if not set); +; script - the main script called (or '-' if not set); +; last request cpu - the %cpu the last request consumed +; it's always 0 if the process is not in Idle state +; because CPU calculation is done when the request +; processing has terminated; +; last request memory - the max amount of memory the last request consumed +; it's always 0 if the process is not in Idle state +; because memory calculation is done when the request +; processing has terminated; +; If the process is in Idle state, then informations are related to the +; last request the process has served. Otherwise informations are related to +; the current request being served. +; Example output: +; ************************ +; pid: 31330 +; state: Running +; start time: 01/Jul/2011:17:53:49 +0200 +; start since: 63087 +; requests: 12808 +; request duration: 1250261 +; request method: GET +; request URI: /test_mem.php?N=10000 +; content length: 0 +; user: - +; script: /home/fat/web/docs/php/test_mem.php +; last request cpu: 0.00 +; last request memory: 0 +; +; Note: There is a real-time FPM status monitoring sample web page available +; It's available in: @EXPANDED_DATADIR@/fpm/status.html +; +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;pm.status_path = /status + +; The ping URI to call the monitoring page of FPM. If this value is not set, no +; URI will be recognized as a ping page. This could be used to test from outside +; that FPM is alive and responding, or to +; - create a graph of FPM availability (rrd or such); +; - remove a server from a group if it is not responding (load balancing); +; - trigger alerts for the operating team (24/7). +; Note: The value must start with a leading slash (/). The value can be +; anything, but it may not be a good idea to use the .php extension or it +; may conflict with a real PHP file. +; Default Value: not set +;ping.path = /ping + +; This directive may be used to customize the response of a ping request. The +; response is formatted as text/plain with a 200 response code. +; Default Value: pong +;ping.response = pong + +; The access log file +; Default: not set +;access.log = log/$pool.access.log + +; The access log format. +; The following syntax is allowed +; %%: the '%' character +; %C: %CPU used by the request +; it can accept the following format: +; - %{user}C for user CPU only +; - %{system}C for system CPU only +; - %{total}C for user + system CPU (default) +; %d: time taken to serve the request +; it can accept the following format: +; - %{seconds}d (default) +; - %{miliseconds}d +; - %{mili}d +; - %{microseconds}d +; - %{micro}d +; %e: an environment variable (same as $_ENV or $_SERVER) +; it must be associated with embraces to specify the name of the env +; variable. Some exemples: +; - server specifics like: %{REQUEST_METHOD}e or %{SERVER_PROTOCOL}e +; - HTTP headers like: %{HTTP_HOST}e or %{HTTP_USER_AGENT}e +; %f: script filename +; %l: content-length of the request (for POST request only) +; %m: request method +; %M: peak of memory allocated by PHP +; it can accept the following format: +; - %{bytes}M (default) +; - %{kilobytes}M +; - %{kilo}M +; - %{megabytes}M +; - %{mega}M +; %n: pool name +; %o: output header +; it must be associated with embraces to specify the name of the header: +; - %{Content-Type}o +; - %{X-Powered-By}o +; - %{Transfert-Encoding}o +; - .... +; %p: PID of the child that serviced the request +; %P: PID of the parent of the child that serviced the request +; %q: the query string +; %Q: the '?' character if query string exists +; %r: the request URI (without the query string, see %q and %Q) +; %R: remote IP address +; %s: status (response code) +; %t: server time the request was received +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %T: time the log has been written (the request has finished) +; it can accept a strftime(3) format: +; %d/%b/%Y:%H:%M:%S %z (default) +; The strftime(3) format must be encapsuled in a %{}t tag +; e.g. for a ISO8601 formatted timestring, use: %{%Y-%m-%dT%H:%M:%S%z}t +; %u: remote user +; +; Default: "%R - %u %t \"%m %r\" %s" +;access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%" + +; The log file for slow requests +; Default Value: not set +; Note: slowlog is mandatory if request_slowlog_timeout is set +;slowlog = log/$pool.log.slow + +; The timeout for serving a single request after which a PHP backtrace will be +; dumped to the 'slowlog' file. A value of '0s' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_slowlog_timeout = 0 + +; The timeout for serving a single request after which the worker process will +; be killed. This option should be used when the 'max_execution_time' ini option +; does not stop script execution for some reason. A value of '0' means 'off'. +; Available units: s(econds)(default), m(inutes), h(ours), or d(ays) +; Default Value: 0 +;request_terminate_timeout = 0 + +; Set open file descriptor rlimit. +; Default Value: system defined value +;rlimit_files = 1024 + +; Set max core size rlimit. +; Possible Values: 'unlimited' or an integer greater or equal to 0 +; Default Value: system defined value +;rlimit_core = 0 + +; Chroot to this directory at the start. This value must be defined as an +; absolute path. When this value is not set, chroot is not used. +; Note: you can prefix with '$prefix' to chroot to the pool prefix or one +; of its subdirectories. If the pool prefix is not set, the global prefix +; will be used instead. +; Note: chrooting is a great security feature and should be used whenever +; possible. However, all PHP paths will be relative to the chroot +; (error_log, sessions.save_path, ...). +; Default Value: not set +;chroot = + +; Chdir to this directory at the start. +; Note: relative path can be used. +; Default Value: current directory or / when chroot +;chdir = /var/www + +; Redirect worker stdout and stderr into main error log. If not set, stdout and +; stderr will be redirected to /dev/null according to FastCGI specs. +; Note: on highloaded environement, this can cause some delay in the page +; process time (several ms). +; Default Value: no +;catch_workers_output = yes + +; Clear environment in FPM workers +; Prevents arbitrary environment variables from reaching FPM worker processes +; by clearing the environment in workers before env vars specified in this +; pool configuration are added. +; Setting to "no" will make all environment variables available to PHP code +; via getenv(), $_ENV and $_SERVER. +; Default Value: yes +;clear_env = no + +; Limits the extensions of the main script FPM will allow to parse. This can +; prevent configuration mistakes on the web server side. You should only limit +; FPM to .php extensions to prevent malicious users to use other extensions to +; exectute php code. +; Note: set an empty value to allow all extensions. +; Default Value: .php +;security.limit_extensions = .php .php3 .php4 .php5 .php7 + +; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from +; the current environment. +; Default Value: clean env +;env[HOSTNAME] = $HOSTNAME +;env[PATH] = /usr/local/bin:/usr/bin:/bin +;env[TMP] = /tmp +;env[TMPDIR] = /tmp +;env[TEMP] = /tmp + +; Additional php.ini defines, specific to this pool of workers. These settings +; overwrite the values previously defined in the php.ini. The directives are the +; same as the PHP SAPI: +; php_value/php_flag - you can set classic ini defines which can +; be overwritten from PHP call 'ini_set'. +; php_admin_value/php_admin_flag - these directives won't be overwritten by +; PHP call 'ini_set' +; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no. + +; Defining 'extension' will load the corresponding shared extension from +; extension_dir. Defining 'disable_functions' or 'disable_classes' will not +; overwrite previously defined php.ini values, but will append the new value +; instead. + +; Note: path INI options can be relative and will be expanded with the prefix +; (pool, global or @prefix@) + +; Default Value: nothing is defined by default except the values in php.ini and +; specified at startup with the -d argument +;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com +;php_flag[display_errors] = off +;php_admin_value[error_log] = /var/log/fpm-php.www.log +;php_admin_flag[log_errors] = on +;php_admin_value[memory_limit] = 32M diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index f08a2c268fe8d..d3d968242826d 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -69,6 +69,19 @@ #define SAPI_LSAPI_MAX_HEADER_LENGTH 2048 +/* Key for each cache entry is dirname(PATH_TRANSLATED). + * + * NOTE: Each cache entry config_hash contains the combination from all user ini files found in + * the path starting from doc_root throught to dirname(PATH_TRANSLATED). There is no point + * storing per-file entries as it would not be possible to detect added / deleted entries + * between separate files. + */ +typedef struct _user_config_cache_entry { + time_t expires; + HashTable user_config; +} user_config_cache_entry; +static HashTable user_config_cache; + static int lsapi_mode = 0; static char *php_self = ""; static char *script_filename = ""; @@ -76,6 +89,7 @@ static int source_highlight = 0; static int ignore_php_ini = 0; static char * argv0 = NULL; static int engine = 1; +static int parse_user_ini = 0; #ifdef ZTS zend_compiler_globals *compiler_globals; zend_executor_globals *executor_globals; @@ -86,6 +100,14 @@ void ***tsrm_ls; zend_module_entry litespeed_module_entry; +static void init_sapi_from_env(sapi_module_struct *sapi_module) +{ + char *p; + p = getenv("LSPHPRC"); + if (p) + sapi_module->php_ini_path_override = p; +} + /* {{{ php_lsapi_startup */ static int php_lsapi_startup(sapi_module_struct *sapi_module) @@ -126,7 +148,11 @@ static void sapi_lsapi_ini_defaults(HashTable *configuration_hash) /* {{{ sapi_lsapi_ub_write */ +#if PHP_MAJOR_VERSION >= 7 +static size_t sapi_lsapi_ub_write(const char *str, size_t str_length TSRMLS_DC) +#else static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC) +#endif { int ret; int remain; @@ -155,7 +181,7 @@ static int sapi_lsapi_ub_write(const char *str, uint str_length TSRMLS_DC) /* {{{ sapi_lsapi_flush */ -static void sapi_lsapi_flush( void * server_context TSRMLS_DC ) +static void sapi_lsapi_flush(void * server_context) { if ( lsapi_mode ) { if ( LSAPI_Flush() == -1) { @@ -195,27 +221,30 @@ static char *sapi_lsapi_getenv( char * name, size_t name_len TSRMLS_DC ) /* }}} */ - +#if PHP_MAJOR_VERSION > 4 static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen, - void * arg ) + void * arg TSRMLS_DC) { #if PHP_MAJOR_VERSION >= 7 - int filter_arg = (Z_ARR_P((zval *)arg) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV])) + int filter_arg = (Z_ARR_P((zval *)arg) == Z_ARR(PG(http_globals)[TRACK_VARS_ENV])) ? PARSE_ENV : PARSE_SERVER; + size_t new_val_len; #else int filter_arg = (arg == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER; + unsigned int new_val_len; #endif + char * new_val = (char *) pValue; - unsigned int new_val_len; if (sapi_module.input_filter(filter_arg, (char *)pKey, &new_val, valLen, &new_val_len TSRMLS_CC)) { - php_register_variable_safe((char *)pKey, new_val, new_val_len, (zval *)arg ); + php_register_variable_safe((char *)pKey, new_val, new_val_len, (zval *)arg TSRMLS_CC); } - return 1; + return 1; } -/* +#else + static int add_variable( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { @@ -227,14 +256,26 @@ static int add_variable( const char * pKey, int keyLen, const char * pValue, int Z_STRLEN_P( gpc_element ) = valLen; Z_STRVAL_P( gpc_element ) = estrndup(pValue, valLen); Z_TYPE_P( gpc_element ) = IS_STRING; -#if PHP_MAJOR_VERSION > 4 - zend_symtable_update( symtable1, pKey1, keyLen + 1, &gpc_element, sizeof( zval *), (void **) &gpc_element_p ); -#else zend_hash_update( symtable1, pKey1, keyLen + 1, &gpc_element, sizeof( zval *), (void **) &gpc_element_p ); -#endif return 1; } -*/ +#endif + + +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 +struct param_zts +{ + void *arg; + TSRMLS_D ; +}; + +static int add_variable_zts(const char * pKey, int keyLen, const char * pValue, int valLen, + void * arg ) +{ + struct param_zts * params = (struct param_zts *)arg; + return add_variable(pKey, keyLen, pValue, valLen, params->arg, params->TSRMLS_C); +} +#endif static void litespeed_php_import_environment_variables(zval *array_ptr TSRMLS_DC) { @@ -330,6 +371,11 @@ static int add_variable_magic_quote( const char * pKey, int keyLen, const char * static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC) { char * php_self = ""; +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 + struct param_zts params; + params.arg = track_vars_array; + params.TSRMLS_C = TSRMLS_C; +#endif if ( lsapi_mode ) { if ( (SG(request_info).request_uri ) ) php_self = (SG(request_info).request_uri ); @@ -339,9 +385,15 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC) #if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5) if (!PG(magic_quotes_gpc)) { #endif +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 + LSAPI_ForeachHeader( add_variable_zts, ¶ms ); + LSAPI_ForeachEnv( add_variable_zts, ¶ms ); +#else LSAPI_ForeachHeader( add_variable, track_vars_array ); LSAPI_ForeachEnv( add_variable, track_vars_array ); - add_variable("PHP_SELF", 8, php_self, strlen( php_self ), track_vars_array ); +#endif + add_variable("PHP_SELF", 8, php_self, strlen( php_self ), + track_vars_array TSRMLS_CC); #if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5) } else { LSAPI_ForeachHeader( add_variable_magic_quote, track_vars_array ); @@ -365,7 +417,11 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC) /* {{{ sapi_lsapi_read_post */ +#if PHP_MAJOR_VERSION >= 7 +static size_t sapi_lsapi_read_post(char *buffer, size_t count_bytes TSRMLS_DC) +#else static int sapi_lsapi_read_post(char *buffer, uint count_bytes TSRMLS_DC) +#endif { if ( lsapi_mode ) { return LSAPI_ReadReqBody( buffer, (unsigned long long)count_bytes ); @@ -430,7 +486,11 @@ static int sapi_lsapi_send_headers(sapi_headers_struct *sapi_headers TSRMLS_DC) /* {{{ sapi_lsapi_send_headers */ -static void sapi_lsapi_log_message(char *message TSRMLS_DC) +static void sapi_lsapi_log_message(char *message +#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 1) + , int syslog_type_int /* unused */ +#endif + TSRMLS_DC) { char buf[8192]; int len = strlen( message ); @@ -444,13 +504,33 @@ static void sapi_lsapi_log_message(char *message TSRMLS_DC) } /* }}} */ +/* Set to 1 to turn on log messages useful during development: + */ +#if 0 +static void log_message (const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + char buf[0x100]; + vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + sapi_lsapi_log_message(buf +#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 1) + , 0 +#endif + ); +} +#define DEBUG_MESSAGE(fmt, ...) log_message("LS:%d " fmt "\n", __LINE__, ##__VA_ARGS__) +#else +#define DEBUG_MESSAGE(fmt, ...) +#endif /* {{{ sapi_module_struct cgi_sapi_module */ static sapi_module_struct lsapi_sapi_module = { "litespeed", - "LiteSpeed V6.9", + "LiteSpeed V6.10", php_lsapi_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ @@ -475,6 +555,10 @@ static sapi_module_struct lsapi_sapi_module = sapi_lsapi_register_variables, /* register server variables */ sapi_lsapi_log_message, /* Log message */ +#if PHP_MAJOR_VERSION > 7 || (PHP_MAJOR_VERSION == 7 && PHP_MINOR_VERSION >= 1) + NULL, /* Get request time */ + NULL, /* Child terminate */ +#else NULL, /* php.ini path override */ NULL, /* block interruptions */ NULL, /* unblock interruptions */ @@ -483,6 +567,7 @@ static sapi_module_struct lsapi_sapi_module = NULL, /* executable location */ 0, /* php.ini ignore */ +#endif STANDARD_SAPI_MODULE_PROPERTIES @@ -588,6 +673,7 @@ static int lsapi_execute_script( zend_file_handle * file_handle TSRMLS_DC) } +static int lsapi_activate_user_ini(TSRMLS_D); static int lsapi_module_main(int show_source TSRMLS_DC) { @@ -596,6 +682,12 @@ static int lsapi_module_main(int show_source TSRMLS_DC) if (php_request_startup(TSRMLS_C) == FAILURE ) { return -1; } + +#if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) + if (parse_user_ini && lsapi_activate_user_ini(TSRMLS_C) == FAILURE) { + return -1; + } +#endif if (show_source) { zend_syntax_highlighter_ini syntax_highlighter_ini; @@ -632,23 +724,368 @@ static int alter_ini( const char * pKey, int keyLen, const char * pValue, int va engine = 0; } else - { + { #if PHP_MAJOR_VERSION >= 7 - psKey = STR_INIT( pKey, keyLen, 1 ); - zend_alter_ini_entry(psKey, + --keyLen; + psKey = zend_string_init( pKey, keyLen, 1 ); + zend_alter_ini_entry_chars(psKey, (char *)pValue, valLen, type, PHP_INI_STAGE_ACTIVATE); - STR_RELEASE( psKey ); + zend_string_release( psKey ); #else zend_alter_ini_entry((char *)pKey, keyLen, (char *)pValue, valLen, type, PHP_INI_STAGE_ACTIVATE); #endif - } + } } return 1; } +static void user_config_cache_entry_dtor( +#if PHP_MAJOR_VERSION >= 7 + zval +#else + void +#endif + *el) +{ + user_config_cache_entry *entry = +#if PHP_MAJOR_VERSION >= 7 + (user_config_cache_entry *)Z_PTR_P(el) +#else + *(user_config_cache_entry **)el +#endif + ; + zend_hash_destroy(&entry->user_config); + free(entry); +} + +static void user_config_cache_init() +{ + zend_hash_init(&user_config_cache, 0, NULL, user_config_cache_entry_dtor, 1); +} + +static int pathlen_without_trailing_slash(char *path) +{ + int len = (int)strlen(path); + while (len > 1 && /* mind "/" as root dir */ + path[len-1] == DEFAULT_SLASH) + { + --len; + } + return len; +} + +static inline char* skip_slash(char *s) +{ + while (*s == DEFAULT_SLASH) { + ++s; + } + return s; +} + +/** + * Walk down the path_stop starting at path_start. + * + * If path_start = "/path1" and path_stop = "/path1/path2/path3" + * the callback will be called 3 times with the next args: + * + * 1. "/path1/path2/path3" + * ^ end + * ^ start + * 2. "/path1/path2/path3" + * ^ end + * ^ start + * 3. "/path1/path2/path3" + * ^ end + * ^ start + * + * path_stop has to be a subdir of path_start + * or to be path_start itself. + * + * Both path args have to be absolute. + * Trailing slashes are allowed. + * NULL or empty string args are not allowed. + */ +static void walk_down_the_path(char* path_start, + char* path_stop, + void (*cb)(char* begin, + char* end, + void* data), + void* data) +{ + char *pos = path_stop + pathlen_without_trailing_slash(path_start); + cb(path_stop, pos, data); + + while ((pos = skip_slash(pos))[0]) { + pos = strchr(pos, DEFAULT_SLASH); + if (!pos) { + /* The last token without trailing slash + */ + cb(path_stop, path_stop + strlen(path_stop), data); + return; + } + cb(path_stop, pos, data); + } +} + +#if PHP_MAJOR_VERSION > 5 || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3) + +typedef struct { + char *path; + uint path_len; + char *doc_root; + user_config_cache_entry *entry; +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 + TSRMLS_D ; +#endif +} _lsapi_activate_user_ini_ctx; + +typedef int (*fn_activate_user_ini_chain_t) + (_lsapi_activate_user_ini_ctx *ctx, void* next); + +static int lsapi_activate_user_ini_basic_checks(_lsapi_activate_user_ini_ctx *ctx, + void* next) +{ + int rc = SUCCESS; + fn_activate_user_ini_chain_t *fn_next = next; + + if (!PG(user_ini_filename) || !*PG(user_ini_filename)) { + return SUCCESS; + } + + /* PATH_TRANSLATED should be defined at this stage */ + ctx->path = SG(request_info).path_translated; + if (!ctx->path || !*ctx->path) { + return FAILURE; + } + + ctx->doc_root = sapi_lsapi_getenv("DOCUMENT_ROOT", 0 +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 + , ctx->TSRMLS_C +#endif + ); + DEBUG_MESSAGE("doc_root: %s", ctx->doc_root); + + if (*fn_next) { + rc = (*fn_next)(ctx, fn_next + 1); + } + + return rc; +} + +static int lsapi_activate_user_ini_mk_path(_lsapi_activate_user_ini_ctx *ctx, + void* next) +{ + char *path; + int rc = SUCCESS; + fn_activate_user_ini_chain_t *fn_next = next; + + /* Extract dir name from path_translated * and store it in 'path' */ + ctx->path_len = strlen(ctx->path); + path = ctx->path = estrndup(SG(request_info).path_translated, ctx->path_len); + if (!path) + return FAILURE; + ctx->path_len = zend_dirname(path, ctx->path_len); + DEBUG_MESSAGE("dirname: %s", ctx->path); + + if (*fn_next) { + rc = (*fn_next)(ctx, fn_next + 1); + } + + efree(path); + return rc; +} + +static int lsapi_activate_user_ini_mk_realpath(_lsapi_activate_user_ini_ctx *ctx, + void* next) +{ + char *real_path; + int rc = SUCCESS; + fn_activate_user_ini_chain_t *fn_next = next; + + if (!IS_ABSOLUTE_PATH(ctx->path, ctx->path_len)) { + real_path = tsrm_realpath(ctx->path, NULL +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 + , ctx->TSRMLS_C +#endif + ); + if (!real_path) { + return SUCCESS; + } + ctx->path = real_path; + ctx->path_len = strlen(ctx->path); + DEBUG_MESSAGE("calculated tsrm realpath: %s", real_path); + } else { + DEBUG_MESSAGE("%s is an absolute path", ctx->path); + real_path = NULL; + } + + if (*fn_next) { + rc = (*fn_next)(ctx, fn_next + 1); + } + + if (real_path) + efree(real_path); + return rc; +} + +static int lsapi_activate_user_ini_mk_user_config(_lsapi_activate_user_ini_ctx *ctx, + void* next) +{ + fn_activate_user_ini_chain_t *fn_next = next; + + /* Find cached config entry: If not found, create one */ +#if PHP_MAJOR_VERSION >= 7 + ctx->entry = zend_hash_str_find_ptr(&user_config_cache, ctx->path, ctx->path_len); +#else + { + user_config_cache_entry **entry_pp; + if (SUCCESS == zend_hash_find(&user_config_cache, ctx->path, + ctx->path_len + 1, (void **) &entry_pp)) + ctx->entry = *entry_pp; + else + ctx->entry = NULL; + } +#endif + + if (ctx->entry) { + DEBUG_MESSAGE("found entry for %s", ctx->path); + } else { + DEBUG_MESSAGE("entry for %s not found, creating new entry", ctx->path); + ctx->entry = pemalloc(sizeof(user_config_cache_entry), 1); + ctx->entry->expires = 0; + zend_hash_init(&ctx->entry->user_config, 0, NULL, +#if PHP_MAJOR_VERSION <= 5 + (dtor_func_t) +#endif + config_zval_dtor, 1); +#if PHP_MAJOR_VERSION >= 7 + zend_hash_str_update_ptr(&user_config_cache, ctx->path, + ctx->path_len, ctx->entry); +#else + zend_hash_update(&user_config_cache, ctx->path, ctx->path_len + 1, + &ctx->entry, sizeof(&ctx->entry), NULL); +#endif + } + + if (*fn_next) { + return (*fn_next)(ctx, fn_next + 1); + } else { + return SUCCESS; + } +} + +static void walk_down_the_path_callback(char* begin, + char* end, + void* data) +{ + _lsapi_activate_user_ini_ctx *ctx = data; + char tmp = end[0]; + end[0] = 0; + DEBUG_MESSAGE("parsing %s%c%s", begin, DEFAULT_SLASH, PG(user_ini_filename)); + php_parse_user_ini_file(begin, PG(user_ini_filename), &ctx->entry->user_config +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 + , ctx->TSRMLS_C +#endif + ); + end[0] = tmp; +} + +static int lsapi_activate_user_ini_walk_down_the_path(_lsapi_activate_user_ini_ctx *ctx, + void* next) +{ + time_t request_time = sapi_get_request_time( +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 + ctx->TSRMLS_C +#endif + ); + uint path_len, docroot_len; + int rc = SUCCESS; + fn_activate_user_ini_chain_t *fn_next = next; + + if (!ctx->entry->expires || request_time > ctx->entry->expires) + { + docroot_len = ctx->doc_root && ctx->doc_root[0] + ? pathlen_without_trailing_slash(ctx->doc_root) + : 0; + + int is_outside_of_docroot = !docroot_len || + ctx->path_len < docroot_len || + strncmp(ctx->path, ctx->doc_root, docroot_len) != 0; + + if (is_outside_of_docroot) { + php_parse_user_ini_file(ctx->path, PG(user_ini_filename), &ctx->entry->user_config +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 + , ctx->TSRMLS_C +#endif + ); + } else { + walk_down_the_path(ctx->doc_root, ctx->path, + &walk_down_the_path_callback, ctx); + } + + ctx->entry->expires = request_time + PG(user_ini_cache_ttl); + } + + if (*fn_next) { + rc = (*fn_next)(ctx, fn_next + 1); + } + + return rc; +} + +static int lsapi_activate_user_ini_finally(_lsapi_activate_user_ini_ctx *ctx, + void* next) +{ + int rc = SUCCESS; + fn_activate_user_ini_chain_t *fn_next = next; + + DEBUG_MESSAGE("calling php_ini_activate_config()"); + php_ini_activate_config(&ctx->entry->user_config, PHP_INI_PERDIR, PHP_INI_STAGE_HTACCESS +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 + , ctx->TSRMLS_C +#endif + ); + + if (*fn_next) { + rc = (*fn_next)(ctx, fn_next + 1); + } + + return rc; +} + +static int lsapi_activate_user_ini(TSRMLS_D) +{ + _lsapi_activate_user_ini_ctx ctx; + /** + * The reason to have this function list stacked + * is each function now can define a scoped destructor. + * + * Passing control via function pointer is a sign of low coupling, + * which means dependencies between these functions are to be + * controlled from a single place + * (here below, by modifying this function list order) + */ + static const fn_activate_user_ini_chain_t fn_chain[] = { + &lsapi_activate_user_ini_basic_checks, + &lsapi_activate_user_ini_mk_path, + &lsapi_activate_user_ini_mk_realpath, + &lsapi_activate_user_ini_mk_user_config, + &lsapi_activate_user_ini_walk_down_the_path, + &lsapi_activate_user_ini_finally, + NULL + }; + +#if defined(ZTS) && PHP_MAJOR_VERSION < 7 + ctx.TSRMLS_C = TSRMLS_C; +#endif + + return fn_chain[0](&ctx, (fn_activate_user_ini_chain_t*)(fn_chain + 1)); +} + +#endif static void override_ini() { @@ -809,11 +1246,11 @@ static int cli_main( int argc, char * argv[] ) #endif for( ini = ini_defaults; *ini; ini+=2 ) { #if PHP_MAJOR_VERSION >= 7 - psKey = STR_INIT( *ini, strlen( *ini ), 1 ); - zend_alter_ini_entry( psKey, + psKey = zend_string_init( *ini, strlen( *ini ), 1 ); + zend_alter_ini_entry_chars( psKey, (char *)*(ini+1), strlen( *(ini+1) ), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); - STR_RELEASE( psKey ); + zend_string_release( psKey ); #else zend_alter_ini_entry( (char *)*ini, strlen( *ini )+1, (char *)*(ini+1), strlen( *(ini+1) ), @@ -842,9 +1279,9 @@ static int cli_main( int argc, char * argv[] ) case 'v': if (php_request_startup(TSRMLS_C) != FAILURE) { #if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2015 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2016 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2015 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); #endif #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); @@ -1065,6 +1502,11 @@ int main( int argc, char * argv[] ) #endif lsapi_sapi_module.executable_location = argv[0]; + + /* Initialize from environment variables before processing command-line + * options: the latter override the former. + */ + init_sapi_from_env(&lsapi_sapi_module); if ( ignore_php_ini ) lsapi_sapi_module.php_ini_ignore = 1; @@ -1148,17 +1590,24 @@ int main( int argc, char * argv[] ) /* LiteSpeed PHP module starts here */ +#if PHP_MAJOR_VERSION > 4 + /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO(arginfo_litespeed__void, 0) ZEND_END_ARG_INFO() /* }}} */ +#else +#define arginfo_litespeed__void NULL +#endif + PHP_FUNCTION(litespeed_request_headers); PHP_FUNCTION(litespeed_response_headers); PHP_FUNCTION(apache_get_modules); PHP_MINFO_FUNCTION(litespeed); + zend_function_entry litespeed_functions[] = { PHP_FE(litespeed_request_headers, arginfo_litespeed__void) PHP_FE(litespeed_response_headers, arginfo_litespeed__void) @@ -1171,6 +1620,12 @@ zend_function_entry litespeed_functions[] = { static PHP_MINIT_FUNCTION(litespeed) { + user_config_cache_init(); + + const char *p = getenv("LSPHP_ENABLE_USER_INI"); + if (p && 0 == strcasecmp(p, "on")) + parse_user_ini = 1; + /* REGISTER_INI_ENTRIES(); */ return SUCCESS; } @@ -1178,6 +1633,8 @@ static PHP_MINIT_FUNCTION(litespeed) static PHP_MSHUTDOWN_FUNCTION(litespeed) { + zend_hash_destroy(&user_config_cache); + /* UNREGISTER_INI_ENTRIES(); */ return SUCCESS; } @@ -1198,11 +1655,11 @@ zend_module_entry litespeed_module_entry = { static int add_associate_array( const char * pKey, int keyLen, const char * pValue, int valLen, void * arg ) { - add_assoc_string_ex( (zval *)arg, (char *)pKey, keyLen+1, (char *)pValue #if PHP_MAJOR_VERSION < 7 - , 1 + add_assoc_string_ex((zval *)arg, (char *)pKey, keyLen+1, (char *)pValue, 1); +#else + add_assoc_string_ex((zval *)arg, (char *)pKey, keyLen, (char *)pValue); #endif - ); return 1; } @@ -1256,11 +1713,11 @@ PHP_FUNCTION(litespeed_response_headers) headerBuf[len] = 0; if ( len ) { while( isspace(*++p)); - add_assoc_string_ex(return_value, headerBuf, len+1, p #if PHP_MAJOR_VERSION < 7 - , 1 + add_assoc_string_ex(return_value, headerBuf, len+1, p, 1); +#else + add_assoc_string_ex(return_value, headerBuf, len, p); #endif - ); } } } diff --git a/sapi/litespeed/lsapilib.c b/sapi/litespeed/lsapilib.c index 75bd30e2b9bfe..be3df2f79ac19 100644 --- a/sapi/litespeed/lsapilib.c +++ b/sapi/litespeed/lsapilib.c @@ -2639,7 +2639,6 @@ static int lsapi_init_children_status() perror( "Anonymous mmap() failed" ); return -1; } - memset( pBuf, 0, size ); g_prefork_server->m_pChildrenStatus = (lsapi_child_status *)pBuf; g_prefork_server->m_pChildrenStatusCur = (lsapi_child_status *)pBuf; g_prefork_server->m_pChildrenStatusEnd = (lsapi_child_status *)pBuf + size / sizeof( lsapi_child_status ); diff --git a/vcsclean b/vcsclean index b5d201b69f405..fc7fc2f805ffb 100755 --- a/vcsclean +++ b/vcsclean @@ -1,6 +1,6 @@ #! /bin/sh -if test -d '.git'; then +if test -d '.git' -o -f '.git'; then ${MAKE:-make} -f build/build.mk gitclean-work else echo "Can't figure out your VCS, not cleaning." diff --git a/win32/build/Makefile b/win32/build/Makefile index 224ef2ae1ec21..87a3e81a55f63 100644 --- a/win32/build/Makefile +++ b/win32/build/Makefile @@ -191,6 +191,7 @@ build-lib: build-ext-libs build-devel: build-headers build-lib @if not exist $(BUILD_DIR_DEV)\script mkdir $(BUILD_DIR_DEV)\script >nul @if not exist $(BUILD_DIR_DEV)\build mkdir $(BUILD_DIR_DEV)\build >nul + @copy run-tests.php $(BUILD_DIR_DEV)\script\ /y >nul @copy win32\build\confutils.js $(BUILD_DIR_DEV)\script\ /y >nul @copy win32\build\configure.tail $(BUILD_DIR_DEV)\script\ /y >nul @copy win32\build\config.w32.phpize.in $(BUILD_DIR_DEV)\script\ /y >nul diff --git a/win32/build/Makefile.phpize b/win32/build/Makefile.phpize index 1f92f7716c481..28ad5ceb7ef6f 100644 --- a/win32/build/Makefile.phpize +++ b/win32/build/Makefile.phpize @@ -26,6 +26,15 @@ clean: clean-pecl @for %D in (_x $(BUILD_DIRS_SUB)) do @if exist %D @del /F /Q %D\*.* > NUL -@del /F /Q $(BUILD_DIR)\*.res $(BUILD_DIR)\*.lib $(BUILD_DIR)\*.ilk $(BUILD_DIR)\*.pdb $(BUILD_DIR)\*.exp $(PHPDEF) $(BUILD_DIR)\php-$(PHP_VERSION_STRING)-Win32.zip $(BUILD_DIR)\pecl-$(PHP_VERSION_STRING)-Win32.zip > NUL +!if "$(EXT_TARGETS)" == "" +_EXTENSION_DLL=$(PECL_TARGETS) +!else +_EXTENSION_DLL=$(EXT_TARGETS) +!endif + +test: + "$(PHP_PREFIX)\php.exe" -d open_basedir= -d output_buffering=0 run-tests.php $(TESTS) -p "$(PHP_PREFIX)\php.exe" -d extension=$(BUILD_DIR)\$(_EXTENSION_DLL) + !if $(MT) == "" _VC_MANIFEST_EMBED_EXE= _VC_MANIFEST_EMBED_DLL= diff --git a/win32/build/config.w32.phpize.in b/win32/build/config.w32.phpize.in index 5b211f804ec91..d5cec2c178dae 100644 --- a/win32/build/config.w32.phpize.in +++ b/win32/build/config.w32.phpize.in @@ -150,7 +150,7 @@ if (VCVERS >= 1400) { } } -ARG_WITH('prefix', 'PHP installation prefix', ''); +ARG_WITH('prefix', 'PHP installation prefix', PHP_PREFIX); ARG_WITH('mp', 'Tell VC9+ use up to [n,auto,disable] processes for compilation', 'auto'); if (VCVERS >= 1500 && PHP_MP != 'disable') { // no from disable-all diff --git a/win32/build/libs_version.txt b/win32/build/libs_version.txt index faca5d8c12333..8bb2175e68307 100644 --- a/win32/build/libs_version.txt +++ b/win32/build/libs_version.txt @@ -1,9 +1,9 @@ bz2-1.0.6 cclient-2007f freetype-2.6.2 -icu-56.1 -jpeglib-9a -libcurl-7.47.1 +icu-57.1 +jpeglib-9b +libcurl-7.50.1 libiconv-1.14 libmcrypt-2.5.8 libmpir-2.7.2 @@ -11,6 +11,6 @@ libpng-1.5.26 libpq-9.4.5 libssh2-1.7.0 libtidy-20090406 -libxslt-1.1.27 -libxml-2.9.3 +libxslt-1.1.29 +libxml-2.9.4 openssl-1.0.1t diff --git a/win32/build/phpize.js.in b/win32/build/phpize.js.in index c99dece6181a7..5156cd23b1898 100644 --- a/win32/build/phpize.js.in +++ b/win32/build/phpize.js.in @@ -268,3 +268,5 @@ C.Write(file_get_contents(PHP_DIR + "\\script\\configure.tail")); B.WriteLine("@echo off"); B.WriteLine("cscript /nologo configure.js %*"); + +FSO.CopyFile(PHP_DIR + "\\script\\run-tests.php", "run-tests.php", true);