Commit Graph

9029 Commits

Author SHA1 Message Date
Stanislav Malyshev
88eb7ea47d Fixed bug #68044: Integer overflow in unserialize() (32-bits only) 2014-10-14 10:44:57 -07:00
Stanislav Malyshev
9aa9014523 Fixed bug #68044: Integer overflow in unserialize() (32-bits only) 2014-10-14 10:43:13 -07:00
Anatol Belski
6445c4bd48 use php_socket_t instead of int 2014-10-10 19:00:19 +02:00
Tjerk Meesters
2a765d313e pack(): Use SIZEOF_ZEND_LONG instead of SIZEOF_LONG 2014-10-10 07:20:10 +08:00
Tjerk Meesters
284358b317 Merge branch 'PHP-5.6'
* PHP-5.6:
  Add 64 bit formats to pack() and unpack()
2014-10-10 07:05:36 +08:00
Leigh
63fd969300 Add 64 bit formats to pack() and unpack() 2014-10-09 21:02:42 +01:00
Nikita Popov
df79b9b27a Update get_class_name semantics
* get_class_name is now only used for displaying the class name
   in debugging functions like var_dump, print_r, etc. It is no
   longer used in get_class() etc.
 * As it is no longer used in get_parent_class() the parent
   argument is now gone. This also fixes incorrect parent classes
   being reported in COM.
 * get_class_name is now always required (previously some places
   made it optional and some required it) and is also required
   to return a non-NULL value.
 * Remove zend_get_object_classname. This also fixes a number of
   potential leaks due to incorrect usage of this function.
2014-10-09 20:48:27 +02:00
Nikita Popov
e5e9d8346f Remove zend_get_class_entry function 2014-10-09 14:17:30 +02:00
Nikita Popov
ee5b30fa19 Remove support for classes without class entries
get_class_entry must be non-NULL and return non-NULL.
2014-10-09 13:58:14 +02:00
Nikita Popov
a3b880364f Directly use zend_string for php_implode/php_explode
Also drop some unnecessary zval separations and copies
2014-10-09 12:05:56 +02:00
Tjerk Meesters
78156520ae Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS for #68129
  Updated NEWS for #68129
  Fixed bug #68129
2014-10-09 08:24:58 +08:00
Tjerk Meesters
f92c9b3ced Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS for #68129
  Fixed bug #68129
2014-10-09 08:24:05 +08:00
Tjerk Meesters
d0e51f5ce9 Fixed bug #68129
Empty usernames and passwords are now treated differently from no username or password

For example, empty password:

    ftp://user:@example.org

Empty username:

    ftp://:password@example.org

Empty username and empty password

    ftp://:@example.org
2014-10-09 08:21:30 +08:00
Leigh
f66013df94 Apply error-code-salt fix to Windows too 2014-10-07 13:12:38 +01:00
Leigh
4e8c876120 Bug fixes in light of failing bcrypt tests 2014-10-07 12:27:57 +01:00
Leigh
a0420a72af Add tests from 1.3. Add missing tests.
3 of the missing tests fail. // TODO
2014-10-07 11:50:36 +01:00
Leigh
e331f9af73 Upgrade crypt_blowfish to version 1.3 2014-10-07 11:23:24 +01:00
Anatol Belski
e9b2340151 fix asinh delivering -0 when the arg is 0 2014-10-03 22:18:21 +02:00
Dmitry Stogov
bd9a234645 Replaced EG(This) and EX(object) with EX(This).
Internal functions now recieves zend_execute_data as the first argument.
2014-10-03 19:32:46 +04:00
Remi Collet
26a5627cc6 only no_NO.ISO-8859-1 have to be ignored (merged) 2014-10-01 10:15:13 +02:00
Remi Collet
3e6f176733 only no_NO.ISO-8859-1 have to be ignored 2014-10-01 10:14:14 +02:00
krakjoe
7cbd8f8b8a remove bogus locale use from test 2014-10-01 10:12:06 +02:00
Nikita Popov
142a01db92 Fix a couple compile warnings 2014-09-29 20:57:17 +02:00
Anatol Belski
e46187daf5 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix test filename
2014-09-29 20:31:02 +02:00
Anatol Belski
df4d559881 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix test filename
2014-09-29 20:30:43 +02:00
Anatol Belski
7f1239232e fix test filename 2014-09-29 20:30:18 +02:00
Anatol Belski
a81a392117 Merge branch 'PHP-5.6'
* PHP-5.6:
  one more test to illustrate transfer of an arbitrary data amount throug pipes
2014-09-29 20:19:51 +02:00
Anatol Belski
cc3849f039 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  one more test to illustrate transfer of an arbitrary data amount throug pipes
2014-09-29 20:19:31 +02:00
Anatol Belski
1a2a8c6d4e one more test to illustrate transfer of an arbitrary data amount throug pipes 2014-09-29 20:18:33 +02:00
Anatol Belski
6090c3cf83 Merge branch 'PHP-5.6'
* PHP-5.6:
  fix tests on linux
  better test cleanup
2014-09-29 18:13:16 +02:00
Anatol Belski
70ff3ad7d1 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix tests on linux
  better test cleanup
2014-09-29 18:12:56 +02:00
Anatol Belski
859913f6d4 fix tests on linux 2014-09-29 18:12:25 +02:00
Anatol Belski
91d3cd8559 better test cleanup
and even force the XFAIL to fail as it would take too long anyway, even if it passes
2014-09-29 18:11:06 +02:00
Anatol Belski
78e23758b7 Merge branch 'PHP-5.6'
* PHP-5.6:
  updated NEWS
  Fixed bug #51800 proc_open on Windows hangs forever

Conflicts:
	main/streams/plain_wrapper.c
2014-09-29 16:30:40 +02:00
Anatol Belski
87a37f4090 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #51800 proc_open on Windows hangs forever
2014-09-29 16:27:33 +02:00
Anatol Belski
0c982798e0 Fixed bug #51800 proc_open on Windows hangs forever
This loop can block for some minutes, theoretically. Practially
however, this is a 99% non issue for a normal use case. This is
required because read() is synchronous. The PHP streams API wants
to fill its internal buffers, therefore it might try to read some
more data than user has demanded. Also, for a case where we want
to read X bytes, but neither enough data nor EOF arrives, read()
will block until it could fill the buffer. If a counterpart station
runs slowly or delivers not all the data at once, read() would
still be waiting. If we quit too early, we possibly could loose
some data from the pipe. Thus it has to emulate the read()
behaviour, but obviously not completely, just to some grade.

Reading big data amount is for sure an issue on any platforms, it
depends on the pipe buffer size, which is controlled by the system.
On Windows, the buffer size seems to be way too small, which causes
buffer congestion and a dead lock. It is essential to read the pipe
descriptors simultaneously and possibly in the same order as the
opposite writes them.

Thus, this will work with smaller buffer data sizes passed through
pipes. As MSDN states, anonymous pipes don't support asynchronous
operations. Neither anonymous pipes do support select() as they are
not SOCKETs but file descriptors. Consequently - bigger data sizes
will need a better solution based on threads. However it is much
more expencive. Maybe a better solution could be exporting a part
of the internal doing as a userspace function which could perform
some kind of lookahead operation on the pipe descriptor.

This is just the first stone, depending on the user feedback we
might go for further improvements in this area.
2014-09-29 16:24:34 +02:00
Nikita Popov
75860fa8e1 Fix counting of "R:" references in serialize() 2014-09-24 12:06:19 +02:00
Nikita Popov
8be73f2650 Fix tests/serialize/bug64146.phpt
The var hash now retains a reference to its elements, to ensure
that addresses are not reused.

Furthermore the var hash now only stores objects and references
and directly uses their pointer as key, thus making serialization
about two times faster.
2014-09-22 23:48:31 +02:00
Nikita Popov
483697617f Remove php_varname_check
This is a leftover from PHP < 5.4.

Also removed the php_create_empty_class declaration, which no longer
exists.
2014-09-22 18:34:40 +02:00
Anatol Belski
0885e4b1b9 simplify the condition 2014-09-22 09:41:53 +02:00
Nikita Popov
a770d29df7 Add smart_str_append for appending zend_strings
Also replaces usages in Zend/ and ext/standard
2014-09-21 20:58:31 +02:00
Nikita Popov
2a7de9fdbb Rename smart_str_append to smart_str_append_smart_str
It's used only rarely and I'm running out of append names...
2014-09-21 20:49:39 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Anatol Belski
132cd8be0d Merge branch 'pull-request/805'
* pull-request/805:
  Removes accidentally added files.
  Reverts some unwanted changes
  Deletes patch leftovers
  Replaces php5 with php7, without whitespace changes.
2014-09-20 19:46:44 +02:00
Anatol Belski
763bfb4f3b refixed printf fmt, used portable macros 2014-09-20 15:46:19 +02:00
Anatol Belski
1b3569235a forked bug41655 test for windows 2014-09-20 15:14:31 +02:00
Florian MARGAINE
8eb7e7bf7f Merge branch 'master' into issue-67910
Conflicts:
	README.PARAMETER_PARSING_API
	ext/gmp/tests/001.phpt
2014-09-20 10:09:21 +02:00
Florian MARGAINE
cf0303e782 Replaces php5 with php7, without whitespace changes. 2014-09-20 10:01:44 +02:00
Nikita Popov
0cd982f15c Make header C++ compatible 2014-09-19 23:54:58 +02:00
Nikita Popov
31e842472f Make number printing functions less generic
Now that zend_ulong is 64bit on 64bit platforms, it should be
sufficient to always use it, rather than supporting multiple
types.

API changes:
 * _zend_print_unsigned_to_buf and _zend_print_signed_to_buf
   no longer exist.
 * smart_str(ing)_print_long and smart_str(ing)_print_unsigned
   no longer exist.
 * Instead of all these, zend_print_ulong_to_buf and
   zend_print_long_to_buf should be used.
 * smart_str_append_generic_ex no longer exists.
 * smart_str(ing)_append_off_t(_ex) no longer exists, use
   smart_str(ing)_append_long(_ex) instead.
2014-09-19 23:39:07 +02:00
Nikita Popov
ad3e1830ba Use append_unsigned instead of append_long where appropriate 2014-09-19 23:39:07 +02:00
Nikita Popov
37aaccad7d Use inline functions for most of smart_str
smart_str_free_ex no longer exists, always use smart_str_free instead.

smart_str_alloc no longer requires a newlen variable to be in scope,
instead it returns the new length.
2014-09-19 23:39:07 +02:00
Nikita Popov
070667de8d Remove SMART_STR_USE_REALLOC 2014-09-19 23:39:07 +02:00
Anatol Belski
f6c02239ca Merge branch 'PHP-5.6'
* PHP-5.6:
  fix possible array underflow

Conflicts:
	ext/standard/image.c
2014-09-19 20:15:56 +02:00
Anatol Belski
6213d9fc91 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix possible array underflow
2014-09-19 20:13:46 +02:00
Anatol Belski
5d9403f56c fix possible array underflow
there are multiple issues with this code

- php_stream_read() returns an unsigned val, so is >= 0
- if it read less than sizeof(a) bytes, the function operates on garbage
- result->channels is an unsigned val, so >= 0
2014-09-19 20:12:24 +02:00
Anatol Belski
2be8fdcfd6 updated the comment to charset_hint 2014-09-19 19:45:38 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Dmitry Stogov
bccc653185 Avoid double IS_INTERNED() check 2014-09-19 17:32:50 +04:00
Dmitry Stogov
3bc8a958c5 Fixed useless or duplicated IS_INTERNED() checks 2014-09-19 15:41:01 +04:00
Anatol Belski
953386edfd fix an always true condition and improve the error check 2014-09-19 10:33:01 +02:00
Anatol Belski
79bb2a1474 fix conditions 2014-09-19 09:49:32 +02:00
Anatol Belski
6fab907920 there can be only one ... of the identical expressions 2014-09-19 09:26:07 +02:00
Anatol Belski
f25f672916 fix condition 2014-09-19 09:09:20 +02:00
Anatol Belski
4d60f23630 fix printf format 2014-09-19 08:44:35 +02:00
Anatol Belski
c45f4f5461 generalized the case with secure memory zeroing 2014-09-19 01:46:14 +02:00
Anatol Belski
adf753159b remove useless condition 0 > unsigned 2014-09-19 00:06:40 +02:00
Anatol Belski
4722d85c1e zero sensitive data more secure way 2014-09-19 00:06:38 +02:00
Anatol Belski
bb89ac8408 zero sensitive data more secure way 2014-09-19 00:06:37 +02:00
Anatol Belski
732c49b433 fix sprintf format 2014-09-19 00:06:35 +02:00
Anatol Belski
2b77a57d88 zero sensitive data more secure way 2014-09-19 00:06:34 +02:00
Anatol Belski
3fa5064173 remove useless check 2014-09-19 00:06:32 +02:00
Anatol Belski
d41ac22a54 avoid strlen() usage in the loop 2014-09-17 08:59:19 +02:00
Anatol Belski
d594809f27 fix printf fmt 2014-09-17 00:56:42 +02:00
Anatol Belski
dda7a01480 fix signed/unsigned mismatch 2014-09-17 00:56:40 +02:00
Anatol Belski
f2e728616c fix signed/unsigned mismatch warnings 2014-09-17 00:56:38 +02:00
Anatol Belski
7ba43ea052 fix signed/unsigned mismatch 2014-09-16 22:15:27 +02:00
Anatol Belski
8c4ab0d02e fix signed/unsigned mismatch 2014-09-16 21:17:27 +02:00
Nikita Popov
079409bbc2 Switch (un)mangle property name to size_t and zend_string
Also use the _ex variants where possible.
2014-09-16 00:31:27 +02:00
Anatol Belski
066d39020b fix types 2014-09-15 19:46:32 +02:00
Anatol Belski
e591c78d09 revamp serialization to work with size_t for Serializable 2014-09-15 19:46:28 +02:00
Anatol Belski
172ca172d1 correct fix to the natcmp_ex
Till now the actualy length diff between the strings was under
circumstances returned. Whereby for a compare function only return
values of (1, 0, -1) make sense. Thus the old behavior isn't
present anymore, natcmp_ex now behaves as a standard compare function.
2014-09-15 12:58:46 +02:00
Anatol Belski
29f8b21cd7 fix int overflow preserving the old behavior 2014-09-14 16:39:25 +02:00
Anatol Belski
8d075b6e4d better way to zero away sensitive data
memset could be optimized away by the compiler
2014-09-14 11:48:51 +02:00
Anatol Belski
34e39783b1 remove useless casts and checks 2014-09-14 11:00:22 +02:00
Anatol Belski
79f51bd1a0 use the generator to produce the header 2014-09-14 00:43:58 +02:00
Anatol Belski
da10603ec9 update the html table generator 2014-09-14 00:42:48 +02:00
Anatol Belski
26cf7df133 removed the emalloc result check, out of memory will bailout 2014-09-14 00:00:52 +02:00
Anatol Belski
7d194a0e0b replaced the check with assert as it's kinda unusual case 2014-09-13 23:57:53 +02:00
Anatol Belski
87a5aae166 removed extra 1 byte member, padding will be done anyway by the compiler 2014-09-13 23:55:30 +02:00
Anatol Belski
a7690fea7a check if the winver was indeed fetched 2014-09-13 23:21:48 +02:00
Anatol Belski
bce562b75e check emalloc() result 2014-09-13 23:21:47 +02:00
Anatol Belski
e00d48490b better way to check for an empty string 2014-09-13 23:21:46 +02:00
Anatol Belski
f357628fc9 reduce the union size from 24 to 16 bytes on 64 bit 2014-09-13 23:21:44 +02:00
Anatol Belski
47fb7a46ac reduced struct sizes by 8 byte each on 64 bit 2014-09-13 23:21:39 +02:00
Anatol Belski
d578e351a9 fix condition
substraction of two unsigned
2014-09-13 23:21:38 +02:00
Anatol Belski
5092c5490a reduce struct sizes by 8 byte on 64 bit 2014-09-13 23:21:37 +02:00
Anatol Belski
1f9893d0ef avoid strlen() usage in the loop 2014-09-13 23:21:36 +02:00
Anatol Belski
e251ecb6e9 fix possible null ptr deref 2014-09-12 22:31:02 +02:00
Anatol Belski
7ac5a36a2f fix possible nullptr derefrence 2014-09-12 22:18:06 +02:00
Anatol Belski
5257ac4925 fix test which fails if prevous run cleanup failed 2014-09-12 21:35:24 +02:00
Anatol Belski
e254ba32d5 fixed the tests, related to the basename behaviour, bug #66395 2014-09-07 20:11:49 +02:00
Nikita Popov
f4f9b54983 Revert "Move safe_address into zend_multiply.h"
This reverts commit 43b02e169c.

I'm getting symbol resolution issues for zend_error_noreturn in the
opcache.so, so reverting this for now.
2014-09-06 22:12:37 +02:00
Nikita Popov
43b02e169c Move safe_address into zend_multiply.h
This allows reuse in zend_arena_calloc.

Also renamed the function to zend_safe_address as it's no longer
private to the allocator.
2014-09-06 14:03:59 +02:00
Nikita Popov
0c5ac39796 Fix smart_str_append()
Would segfault if src->s == NULL.
2014-09-04 21:55:27 +02:00
Tjerk Meesters
6f6541dc84 Merge branch 'pr/804'
* pr/804:
  Adds phpversion test to prevent #67959
2014-09-05 02:17:42 +08:00
Florian MARGAINE
e338e26ab7 Adds phpversion test to prevent #67959 2014-09-04 20:13:43 +02:00
Tjerk Meesters
6951f8adb0 Merge branch 'pr/803'
* pr/803:
  Fixes zpp parameter from int to size_t
2014-09-05 02:02:20 +08:00
Florian MARGAINE
c24c7ff224 Fixes zpp parameter from int to size_t 2014-09-04 19:59:39 +02:00
Nikita Popov
2b133e9149 Separate php_mb_reset() from php_mblen()
Instead of fighting against warnings ...
2014-09-03 20:37:04 +02:00
Nikita Popov
6cceb54c09 Fix a number of format issues 2014-09-03 15:57:28 +02:00
Dmitry Stogov
e51677b2e6 fixed reference counting 2014-09-02 11:24:52 +04:00
Dmitry Stogov
1670772dc6 Avoid string duplication 2014-09-02 09:52:23 +04:00
Dmitry Stogov
88d7ca44f6 Refactored INI subsystem to use zend_string* instead of char* 2014-09-01 20:57:33 +04:00
Tjerk Meesters
5d5a7b1f7f Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated UPGRADING for #38409
  Updated NEWS for #38409
  Added test case
  Making ini parser typed - Added ZEND_INI_SCANNER_TYPED mode for parse_ini_string() and parse_ini_file() - Added NULL_NULL token to separate it from BOOL_FALSE and BOOL_TRUE - Added zend_ini_copy_typed_value() function for zval initialisation - Updated RETURN_TOKEN() to observe scanner_mode

Conflicts:
	Zend/zend_ini_parser.y
	Zend/zend_ini_scanner.c
2014-09-01 22:43:17 +08:00
Tjerk Meesters
1bf996b324 Added test case 2014-09-01 22:04:25 +08:00
Tjerk Meesters
5270ee1aef Making ini parser typed
- Added ZEND_INI_SCANNER_TYPED mode for parse_ini_string() and parse_ini_file()
- Added NULL_NULL token to separate it from BOOL_FALSE and BOOL_TRUE
- Added zend_ini_copy_typed_value() function for zval initialisation
- Updated RETURN_TOKEN() to observe scanner_mode
2014-09-01 22:04:06 +08:00
Anatol Belski
f4ed876db1 fix acosh for vs2012 and earlier 2014-09-01 15:34:42 +02:00
Anatol Belski
3aa5583cab fix asinh() on win64 for big negative values 2014-09-01 15:34:40 +02:00
Anatol Belski
312181bc13 fix iptcembed() 2014-08-31 14:02:28 +02:00
Nikita Popov
f1c2017851 Don't depend on exact parse error messages in assert tests 2014-08-29 22:07:25 +02:00
Anatol Belski
13ccda7249 fix implicit st_rdev element handling when negative value was passed 2014-08-29 13:30:53 +02:00
Anatol Belski
451856420c data type fixes 2014-08-29 12:53:37 +02:00
Anatol Belski
e206409a8c exclude log2 usage which requires C99 support 2014-08-29 10:55:55 +02:00
Andrea Faulds
389d285973 Special-case aliases, add warning comments to implementations 2014-08-29 00:10:52 +02:00
Anatol Belski
5fc0006d35 skip this if we can't check the uid 2014-08-28 22:22:38 +02:00
Anatol Belski
898e1570a2 fixed trim() and strtok() to work with big strings 2014-08-28 21:59:00 +02:00
Anatol Belski
8e05b9104b fixed strip_tags() and hebrev() to work with big strings 2014-08-28 19:35:37 +02:00
Dmitry Stogov
c8ff3421a0 Duplicate array only if neccessary 2014-08-28 20:51:22 +04:00
Anatol Belski
cf430b9a6f fix linkinfo() 2014-08-27 23:44:28 +02:00
Anatol Belski
e6dcd19aed restore the old part of ezmlm_hash() 2014-08-27 23:14:54 +02:00
Anatol Belski
60373b2ac2 fix signature 2014-08-27 22:17:16 +02:00
Anatol Belski
bf96ee95ce 's' works with size_t round 4 2014-08-27 20:49:37 +02:00
Anatol Belski
6db8d4f829 's' works with size_t round 3 2014-08-27 20:49:36 +02:00
Anatol Belski
257ed4061a 's' works with size_t round 2 2014-08-27 20:49:33 +02:00
Anatol Belski
3234480827 first show to make 's' work with size_t 2014-08-27 20:49:31 +02:00
Nikita Popov
694824f302 Fix test with opcache/zts dependent output
Refcount depends on whether array is immutablized and string is
interned.
2014-08-27 00:31:20 +02:00
Anatol Belski
202e8db1dc fixed several long vs zend_long casts 2014-08-26 11:26:53 +02:00
Xinchen Hui
a3fd5b6954 Unused variable 2014-08-26 11:50:42 +08:00
Xinchen Hui
0a712e1913 Unused variable 2014-08-26 11:49:32 +08:00
Nikita Popov
899a1ed59a Merge branch 'ast'
Conflicts:
	Zend/zend_compile.c
2014-08-25 22:04:33 +02:00
Nikita Popov
6db293d5e0 Merge remote-tracking branch 'php-src/master' into ast
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_globals.h
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner.l
	Zend/zend_types.h
2014-08-25 21:52:18 +02:00
Anatol Belski
af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski
b9514bb8fd master renames phase 6 2014-08-25 21:26:42 +02:00
Anatol Belski
28b7a03318 master renamings phase 5 2014-08-25 21:20:44 +02:00
Anatol Belski
455741fce3 master renames phase 4 2014-08-25 20:57:25 +02:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski
6f9f0bf205 master renames phase 2 2014-08-25 19:28:33 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
70de6180d5 fixes to %pd format usage 2014-08-24 02:35:34 +02:00