Commit Graph

61 Commits

Author SHA1 Message Date
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
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
Rasmus Lerdorf
deca940406 We can't output absolute S and T values for the
Diophantine solution here since it can vary based
on the libgmp version we are linking against and
in general there are almost always multiple valid
solutions
2015-01-09 16:27:09 -08:00
Rasmus Lerdorf
46f429f8e6 We can't output absolute S and T values for the
Diophantine solution here since it can vary based
on the libgmp version we are linking against and
in general there are almost always multiple valid
solutions
2015-01-09 16:23:50 -08:00
Andrea Faulds
e5eb9530ab Use "float" and "integer" in typehint and zpp errors 2014-12-21 13:23:02 +00:00
Leigh
2fe7533ffc gmp_random_seed() 2014-10-19 17:25:05 +01:00
Stanislav Malyshev
afdaedaa26 Merge branch 'PHP-5.6'
* PHP-5.6:
  update NEWS and UPGRADING
  Upated NEWS
  Address issues raised by @nikic
  Make sure min < max
  Mersenne Twister was added in GMP 4.2
  Add test files
  Add gmp_random_bits(bits) and gmp_random_range(min, max)
  Change GMPs default PRNG to Mersenne Twister

Conflicts:
	ext/gmp/gmp.c
2014-10-14 00:43:15 -07:00
Nikita Popov
bb0c142156 Drop support for GMP 4.1
* Consistent base conversion support (max: 62)
 * mpz_remroot always available
 * Use gmp_randinit_mt instead of LCG
2014-09-28 20:46:22 +02:00
Leigh
581c86c07f Make gmp_setbit and gmp_clrbit return values consistent 2014-09-28 20:18:14 +02:00
Leigh
adf8f0f284 Address issues raised by @nikic
- Thread safety on rand init function.
 - Ret false on validation failure
 - Add _dep of temp_a to temp_b
 - Special case int sized min values
 - More tests!
2014-09-24 22:01:09 +01:00
Leigh
3e9a31748d Make sure min < max 2014-09-24 07:56:46 +01:00
Leigh
31e27fc89a Add test files 2014-09-23 22:54:40 +01:00
Nikita Popov
00805ffb92 Merge branch 'PHP-5.6'
Conflicts:
	ext/soap/php_http.c
2014-09-04 21:23:11 +02:00
Nikita Popov
03797a73b2 Split GMP tests testing multiple functions
Also drop dummy test
2014-09-04 21:18:37 +02:00
Nikita Popov
9586b15229 Give proper names to GMP test files 2014-09-04 21:10:41 +02:00
Nikita Popov
15c139b99a Throw warnings when using zero modulus in gmp_powm
Also fixes a leak in this case.
2014-09-04 20:55:09 +02:00
Nikita Popov
f10d194c8c Add GMP tests for some uncovered branches 2014-09-04 20:03:29 +02:00
Nikita Popov
2d364747ca Merge branch 'PHP-5.6'
Conflicts:
	ext/gmp/gmp.c
2014-09-02 19:07:54 +02:00
Nikita Popov
834daa455b Fixed bug #50175
0x and 0b prefix is now only handled if either no base is given
or if the base is 16 (0x) or 2 (0b). Always handling it is incorrect
because 0x and 0b are perfectly valid numbers in other bases.
2014-09-02 19:04:55 +02:00
Nikita Popov
5138f3ba22 Skip 64bit test on 32bit
Also minor type improvements
2014-09-02 18:42:39 +02:00
Anatol Belski
e7386aa1fd add a test with gmp and PHP_INT_MAX 2014-09-02 18:16:19 +02:00
Leigh
47d630e7f0 Implement gmp_import() and gmp_export() 2014-09-02 14:19:18 +02:00
Nikita Popov
5e93a213f6 Add SKIPIF in GMP test 2014-03-12 14:17:08 +01:00
Nikita Popov
a117e6b937 Add tests for bug #66872 and gmp_[rem]root 2014-03-11 14:06:12 +01:00
datibbaw
aff56f3c45 add T_POW (**) operator
Fixed recognition of the operator

Added opcode, still doing multiply instead of pow()

opcode now always returns int(42)

The right answer, but always a float

Yanked code from pow() implementation.

Should not handle negative long as exponent ourselves

Added test cases from pow()

Moved precedence higher than '~'

Added GMP operator overloading

Added ZEND_ASSIGN_POW (**=) operator.

Added pow() as a language construct.

Adjusted test cases for changed precedence.

Reduced pow() to shell function around ZEND_API pow_function()

Reduced test case to only contain edge cases
Added overloading test case

Moved unary minus above T_POW

Revert "Added pow() as a language construct."

Bad bad bad idea.

This reverts commit f60b98cf7a8371233d800a6faa286ddba4432d02.

Reverted unary minus behaviour due to previous revert.
Convert arrays to int(0)
Exponent with array as a base becomes int(0)

Rebase against master

Fixed tokenizer test case
2014-02-06 14:41:21 +01:00
Nikita Popov
5408f1e5a6 Throw warning when converting invalid string to GMP 2013-12-30 14:38:09 +01:00
Nikita Popov
4218e89f8d Fix bug #65997 by switching to Serializable for GMP
Rather than using get_properties and __wakeup for serialization
the code now uses Serializable::serialize() and
Serializable::unserialize(). The get_properties handler is switched
to a get_debug_info handler. Thus get_gc will now return only
the normal properties and not do any modifications, thus fixing
the leak. This also avoids a $num property from being publicly
visible after the object was dumped or serialized, so that's an
extra plus.
2013-10-29 20:58:30 +01:00
Nikita Popov
7713b8c2ac GMP improvements
As per RFC https://wiki.php.net/rfc/operator_overloading_gmp
2013-06-17 17:59:12 +02:00
Anatoliy Belsky
9a72b52a1f fixing test for upcoming mpir upgrade
- mpir is going to be upgraded up to 2.5.1 on windows
2012-08-23 17:09:45 +02:00
Matt Ficken
645d65f3e3 Fixed bug #62068 Test bug - gmp_nextprime and 022 2012-05-21 12:31:16 +02:00
Stanislav Malyshev
b55d4ecb41 Fix bug #52906 gmp_mod returns negative result when non-negative is expected 2010-10-01 00:12:23 +00:00
David Soria Parra
99c43e1b93 Also allow base 62 for gmp_init as requested in (#50283) 2009-11-25 23:38:34 +00:00
David Soria Parra
579a6e39de Really use 62 as the upper boundary as requested and not 32. 2009-11-25 18:15:25 +00:00
David Soria Parra
18f32db810 Implement feature request #50283 (allow base in gmp_strval to use full range: 2 to 62, and -2 to -36) 2009-11-24 13:33:35 +00:00
Nuno Lopes
b2e6a56e5c fix tests 2007-12-27 16:05:00 +00:00
Stanislav Malyshev
7c69bbaec7 add tests for testbit, sync with HEAD 2007-11-01 18:43:34 +00:00
Stanislav Malyshev
d0fffa7a72 generalize resource names 2007-11-01 17:52:20 +00:00
Antony Dovgal
bdcefbdc5d fix 64bit issues & tests 2007-11-01 09:25:11 +00:00
Stanislav Malyshev
eb5bd09cff - Fix memory leaks (bug #42509)
- Fix _gmp_binary_opl
- Use modern parameter parsing
2007-11-01 00:46:13 +00:00
Antony Dovgal
7e1647e524 MFH: add missing skipif sections 2007-05-27 15:12:33 +00:00
Antony Dovgal
1f65545121 fix test names 2007-05-07 18:03:01 +00:00
Antony Dovgal
9fd3c30f94 MFH 2007-05-04 22:32:57 +00:00
Antony Dovgal
a6cd2b4cec MFH: improve the tests 2007-04-27 11:43:45 +00:00
Antony Dovgal
3e7b4e5d1a MFH: add test & GMP_VERSION constant
do not allow zero operand in gmp_divexact()
2007-04-26 13:44:02 +00:00