Commit Graph

2007 Commits

Author SHA1 Message Date
Christoph M. Becker
518a160b65 Fix #78943: mail() may release string with refcount==1 twice
Since we need `headers_lc` as well as `headers_trim` in the following,
we do not release the former even if they are the same string, to avoid
complicating the release logic even more.

A new test case is not necessary, since we already have
mail_basic_alt2-win32.phpt and others.
2019-12-15 13:13:30 -08:00
Christoph M. Becker
bb735c9e9e Fix #78296: is_file fails to detect file
If we're constructing extended-length paths (i.e. paths prefixed with
`\\?\`), we have to replace all forward slashes with backward slashes,
because the former are not supported by Windows for extended-length
paths.

The more efficient and likely cleaner alternative solution would be to
cater to this in `php_win32_ioutil_normalize_path_w()` by always
replacing forward slashes, but that might break existing code.  It
might be sensible to change that for `master`, though.
2019-12-02 11:29:10 +01:00
Christoph M. Becker
fa65f5ecf5 Fix #78212: Segfault in built-in webserver
Since syslog's ident and facility parameters have been added to
config[1], vsyslog() segfaults on Windows, if openlog() has not been
called before.  We bring back the removed lines to fix this.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=2475337bd8a0fad0dac03db3f5e7e9d331d53653>
2019-07-11 13:09:54 +02:00
Christoph M. Becker
fd1ffa4692 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix erroneous assertions
2019-05-09 16:55:35 +02:00
Christoph M. Becker
27f168cf63 Fix erroneous assertions
Since PHP strings are binary safe (i.e. they may contain NUL bytes), we
must not assume that strlen()/wcslen() actually return the length of
the string.  Only if the given in_len is zero, it is safe to assert
this.
2019-05-09 16:54:11 +02:00
Stanislav Malyshev
506a764089 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:10 -07:00
Stanislav Malyshev
2c3933821f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:04 -07:00
Christoph M. Becker
6c631ccfef Fix #77821: Potential heap corruption in TSendMail()
`zend_string_tolower()` returns a copy (not a duplicate) of the given
string, if it is already in lower case.  In this case we must not not
`zend_string_free()` both strings.  The cleanest solution is to call
` zend_string_release()` on both strings, which properly handles the
refcount.
2019-04-29 22:08:19 -07:00
Anatol Belski
5477d68300 Fix potential OPcache file cache related issues
To solve issues detected during testing, we backport the following
commits to PHP 7.2:

129c5c1181
9ac133a0b3
ce72bc6b65
2019-04-11 18:28:49 +02:00
Anatol Belski
ce72bc6b65 Ensure double slashes are replaced by the path normalization 2019-04-10 15:20:36 +02:00
Anatol Belski
a2c87c7f29 Fix memory leak 2019-03-30 21:28:51 +01:00
Christoph M. Becker
7ef2fa6d0d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add bison version check to configure
2019-03-18 15:04:09 +01:00
Christoph M. Becker
f21c054903 Add bison version check to configure
Since we're already checking for the minimum required re2c version,
also checking for the minimum required bison version is sensible.
2019-03-18 15:02:52 +01:00
Anatol Belski
95c8f67a4c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Die hard if mc.exe or mt.exe not found
2019-03-11 20:59:23 +01:00
Anatol Belski
6814ba11bc Die hard if mc.exe or mt.exe not found
Even configure would pass, that producess quite subtle build errors
which are better to avoid at configure stage already.
2019-03-11 20:41:45 +01:00
Christoph M. Becker
42b0bbd758 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Drop deprecated /Gm compile option
2018-12-30 14:37:04 +01:00
Christoph M. Becker
20de58f51d Drop deprecated /Gm compile option
The `/Gm` option of `cl` is deprecated[1], and `cl` claims that it will
be removed in the future, so we're dropping it right away.

[1] <https://docs.microsoft.com/en-us/cpp/build/reference/gm-enable-minimal-rebuild?view=vs-2017>
2018-12-30 14:36:05 +01:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Peter Kokot
1c850bfcca Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

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-14 12:55:24 +02:00
Peter Kokot
60a69daec6 Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

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-14 12:54:08 +02:00
Peter Kokot
03f3b8479b Sync leading and final newlines in source code files
This patch adds missing newlines, trims multiple redundant final
newlines into a single one, and trims redundant leading newlines.

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-14 12:51:01 +02:00
Peter Kokot
3362620b5f Trim trailing whitespace in source code files 2018-10-13 14:16:33 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Peter Kokot
7f6387b59a Trim trailing whitespace in source code files 2018-10-13 14:12:55 +02:00
Peter Kokot
85290bbfcc Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:23:20 +02:00
Peter Kokot
2aa897476f Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:22:30 +02:00
Peter Kokot
3f72c77ce4 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2018-10-13 11:21:27 +02:00
Anatol Belski
8209a8821c Fixed bug #76947 file_put_contents() blocks the directory of the file (__DIR__)
The condition was wrong. The target buffer size only matters, when some
output is going to be copied into it.
2018-10-03 00:15:43 +02:00
Anatol Belski
f608a60456 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add spectre switch for suitable vc14 versions
2018-09-18 10:46:44 +02:00
Anatol Belski
a747db872f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Add spectre switch for suitable vc14 versions
2018-09-18 10:45:18 +02:00
Anatol Belski
be02b2e8fd Add spectre switch for suitable vc14 versions 2018-09-18 10:43:52 +02:00
Anatol Belski
6bd6265845 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Sync version for vc++ 15.9
2018-09-13 19:27:29 +02:00
Anatol Belski
83685b5258 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Sync version for vc++ 15.9
2018-09-13 19:26:49 +02:00
Anatol Belski
d77ac7b3dc Sync version for vc++ 15.9 2018-09-13 19:25:23 +02:00
Anatol Belski
f15fc8ea1e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  mkdist.php: recursively check dll dependencies
2018-08-23 21:27:43 +02:00
Anatol Belski
8f43ec1e83 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  mkdist.php: recursively check dll dependencies
2018-08-23 21:26:40 +02:00
Dylan K. Taylor
b9bf9ddce6 mkdist.php: recursively check dll dependencies
Fix duplication of recursively checked deps
2018-08-23 21:25:54 +02:00
Anatol Belski
2ea7222440 Remove asan incompatible options 2018-08-03 14:10:37 +02:00
Anatol Belski
d53978bd59 Suppress more irrelevant clang warnings 2018-08-01 18:18:37 +02:00
Peter Kokot
d2184efb7b Replace obsolete AC_STRUCT_ST_BLKSIZE and AC_STRUCT_ST_RDEV
Autoconf 2.50 released in 2001 has made several macros obsolete. Instead
of the AC_STRUCT_ST_BLKSIZE and AC_STRUCT_ST_RDEV the new
AC_CHECK_MEMBERS should be used.

When checking for the presence of stat struct members st_blkzize and
st_rdev the new AC_CHECK_MEMBERS macro defines new constants
HAVE_STRUCT_STAT_ST_BLKSIZE and HAVE_STRUCT_STAT_ST_RDEV.

Old constants HAVE_ST_BLKSIZE and HAVE_ST_RDEV need to be replaced
respectively in PHP code (this patch) and in PHP extenstions if they use
them.

PHP 5.4 to 7.1 require Autoconf 2.59+ version, PHP 7.2 and above require
2.64+ version, and the PHP 7.2 phpize script requires 2.59+ version which
are all greater than above mentioned 2.50 version.
2018-07-29 13:59:40 +02:00
Peter Kokot
cf8ef08e20 Fix typos in code 2018-07-27 16:27:41 +02:00
Peter Kokot
a5e80b22e1 Fix typos in code comments 2018-07-25 11:57:11 +02:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Kalle Sommer Nielsen
b1864b0178 Fix HKEY registry path (not that it should matter, dead code, Anatol?) 2018-07-23 15:37:02 +02:00
Anatol Belski
1bcc2fcb4e Avoid early allocation 2018-07-13 07:35:33 +02:00
Anatol Belski
644ab58d0f Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed RecursiveDirectoryIterator with long path or with edge case length
2018-07-12 19:58:43 +02:00
Anatol Belski
f28aeaee05 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed RecursiveDirectoryIterator with long path or with edge case length
2018-07-12 19:57:08 +02:00
Anatol Belski
99fe18503a Fixed RecursiveDirectoryIterator with long path or with edge case length
The search path needs to be appended with the wild card. Till now, an
edge case existed, so then if a path is 259 bytes long, which is smaller
_MAX_PATH, the suffix would cause the final search path to become longer
than _MAX_PATH. It is an edge case, when the starting path happens to
have a specific length. If the starting path was longer than _MAX_PATH
or the addition of "\\*" would not exceed _MAX_PATH, the function was
correct. Except for rewind, which was broken in the case of the long
path.
2018-07-12 19:49:32 +02:00
Anatol Belski
0834679e40 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fix macro
2018-07-12 11:38:18 +02:00
Anatol Belski
9443c61928 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix macro
2018-07-12 11:37:13 +02:00