Commit Graph

274 Commits

Author SHA1 Message Date
Peter Kokot
f1d7e3ca0b Sync leading and final newlines in *.phpt sections
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines in all
*.phpt sections.

According to POSIX, a line is a sequence of zero or more non-' <newline>'
characters plus a terminating '<newline>' character. [1] Files should
normally have at least one final newline character.

C89 [2] and later standards [3] mention a final newline:
"A source file that is not empty shall end in a new-line character,
which shall not be immediately preceded by a backslash character."

Although it is not mandatory for all files to have a final newline
fixed, a more consistent and homogeneous approach brings less of commit
differences issues and a better development experience in certain text
editors and IDEs.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206
[2] https://port70.net/~nsz/c/c89/c89-draft.html#2.1.1.2
[3] https://port70.net/~nsz/c/c99/n1256.html#5.1.1.2
2018-10-15 04:31:31 +02:00
Peter Kokot
17ccbeec32 Trim trailing whitespace in *.phpt 2018-10-14 19:44:14 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Nikita Popov
09bb2527e9 Merge branch 'PHP-7.1' into PHP-7.2 2018-07-02 17:29:32 +02:00
Nikita Popov
c793885b76 Fixed bug #74670
Validate that "C" serialization payload is followed by "}" prior to
calling the unserialize() handler. This mitigates issues caused by
unserialize() not correctly handling strings that are not NUL
terminated. Making sure that there is a "}" at the end avoids the
problem.
2018-07-02 17:27:43 +02:00
Nikita Popov
1b6a9ea584 Merge branch 'PHP-7.1' into PHP-7.2 2018-02-19 21:46:11 +01:00
Nikita Popov
7b3a2d16aa Fix incorrect printf modifiers 2018-02-19 21:44:36 +01:00
Anatol Belski
4635cc5b9d Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Skip on Travis-CI
2018-01-03 18:36:10 +01:00
Anatol Belski
904e0d7212 Skip on Travis-CI
The current doc states max ram for a test VM would be 7.5G, the
currently used container image has even less. This skip should be
revisited, as the available memory amount shifts. The way of checking
/proc/meminfo doesn't work reliably on containers at least, thus
skipping explicitly on Travis-CI makes sense.
2018-01-03 18:32:33 +01:00
Anatol Belski
e282e52967 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Extend skip section
2018-01-03 16:56:00 +01:00
Anatol Belski
2508d5051f Extend skip section
The test requires some untrivial amount of RAM. Added a simple check for
the system free RAM to avoid false positive fails.
2018-01-03 16:54:14 +01:00
Stanislav Malyshev
4380ba7f9c Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix some int/long confusion issues in GMP
2018-01-02 00:12:33 -08:00
Stanislav Malyshev
c0f0a0a862 Fix some int/long confusion issues in GMP
mpz_setbit seems to have limit of INT_MAX * GMP_NUMB_BITS on
the number of bits supported, and will abort() if that limit
is exceeded.
2018-01-02 00:12:24 -08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Nikita Popov
fbeb900be4 Deprecate gmp_random() 2017-02-03 18:52:57 +01:00
Nikita Popov
959c8975a9 Merge branch 'PHP-7.1' 2017-01-14 14:13:49 +01:00
Nikita Popov
6674f81027 Merge branch 'PHP-7.0' into PHP-7.1 2017-01-14 14:13:42 +01:00
Yordan Gigov
60aff0bd30 Fixed bug #69993 2017-01-14 14:13:15 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Christoph M. Becker
fcc6f2df59 Merge branch 'PHP-7.1' 2016-09-06 14:15:05 +02:00
Christoph M. Becker
727b422ad9 Fix #72948: Uncatchable "Catchable" fatal error for class to string conversions
E_RECOVERABLE errors are reported as "Catchable fatal error". This is
misleading, because they actually can't be caught via try-catch statements.
Therefore we change the wording to "Recoverable fatal error" as suggested by
Nikita.
2016-09-03 13:05:37 +02:00
Sara Golemon
665050787c Bugfix#70896 gmp_fact() silently ignores non-integer inputs
Factorials only make sense for integer inputs.
To do something factorial-like, the Gamma Function
should be used instead.
However, at this point it's no longer a factorial.

For PHP/GMP, we'll raise a warning on trying to use
a non-integer input, but carry on returning the truncated
value as we used to (avoiding BC breakage).
2016-07-26 22:04:18 -07:00
Nikita Popov
91f22a2088 Merge branch 'PHP-7.1' 2016-07-25 23:04:25 +02:00
Nikita Popov
4d2479202a Merge branch 'PHP-7.0' into PHP-7.1 2016-07-25 23:04:14 +02:00
Nikita Popov
b1d36cb820 Fix GMP unserialization with self-reference 2016-07-25 23:04:00 +02:00
Nikita Popov
5d0ae32c35 Cleanup gmp_sqrtrem() test 2016-07-25 22:07:56 +02:00
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Stanislav Malyshev
a32e143d4e fix build 2016-04-26 23:04:29 -07:00
Xinchen Hui
c89b7a4860 Use zend_string_safe_alloc 2016-04-27 12:45:02 +08:00
Xinchen Hui
dae086040e Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed test script
2016-03-17 17:07:07 +08:00
Xinchen Hui
6d4aec029a Fixed test script 2016-03-17 17:06:56 +08:00
Nikita Popov
1ac152938c Move semicolon into TSRMLS_CACHE_EXTERN/DEFINE
Also re bug #71575.
2016-03-03 16:50:01 +01:00
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02:00
Dmitry Stogov
424a26d5d4 Split test into different versions for 32-bit and 64-bit systems 2015-10-07 01:51:37 +03:00
Stanislav Malyshev
9b1a224d4e Merge branch 'PHP-5.6'
* PHP-5.6: (21 commits)
  fix unit tests
  update NEWS
  add NEWS for fixes
  Improve fix for #70172
  Fix bug #70312 - HAVAL gives wrong hashes in specific cases
  fix test
  add test
  Fix bug #70366 - use-after-free vulnerability in unserialize() with SplDoublyLinkedList
  Fix bug #70365 - use-after-free vulnerability in unserialize() with SplObjectStorage
  Fix bug #70172 - Use After Free Vulnerability in unserialize()
  Fix bug #70388 - SOAP serialize_function_call() type confusion
  Fixed bug #70350: ZipArchive::extractTo allows for directory traversal when creating directories
  Improve fix for #70385
  Fix bug #70345 (Multiple vulnerabilities related to PCRE functions)
  Fix bug #70385 (Buffer over-read in exif_read_data with TIFF IFD tag byte value of 32 bytes)
  Fix bug #70219 (Use after free vulnerability in session deserializer)
  Fix bug ##70284 (Use after free vulnerability in unserialize() with GMP)
  Fix for bug #69782
  Add CVE IDs asigned (post release) to PHP 5.4.43
  Add CVE IDs asigned to #69085 (PHP 5.4.39)
  ...

Conflicts:
	ext/exif/exif.c
	ext/gmp/gmp.c
	ext/pcre/php_pcre.c
	ext/session/session.c
	ext/session/tests/session_decode_variation3.phpt
	ext/soap/soap.c
	ext/spl/spl_observer.c
	ext/standard/var.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	ext/xsl/xsltprocessor.c
2015-09-02 00:37:20 -07:00
Stanislav Malyshev
d735957cb5 Fix bug ##70284 (Use after free vulnerability in unserialize() with GMP) 2015-08-23 16:08:07 -07:00
Anatol Belski
4e66cce87c switch to the unified globals accessor where appropriate 2015-07-29 13:26:35 +02:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Nikita Popov
25098f0f5c Merge branch 'PHP-5.6' 2015-06-11 22:20:12 +02:00
Nikita Popov
1acf55eb75 Fixed bug #69803 2015-06-11 22:20:05 +02:00
Nikita Popov
c669aaac71 Merge branch 'PHP-5.6'
Conflicts:
	ext/gmp/gmp.c
2015-04-16 16:31:53 +02:00
Nikita Popov
25e45a9350 Run gmp_random tests more quickly 2015-04-16 16:29:57 +02:00
Nikita Popov
7e049b0427 Normalize gmp_remroot() behavior to GMP 5.1 2015-04-16 16:27:42 +02:00
Nikita Popov
8e167a2a00 Fix leak in gmp_pow() 2015-04-16 16:04:19 +02:00
Nikita Popov
feaabd09d0 Fix leak in gmp_pow() 2015-04-16 16:00:47 +02:00
Anatol Belski
2d78023244 cleanup the mod version macros, round 2 2015-03-23 20:33:54 +01:00