Commit Graph

35804 Commits

Author SHA1 Message Date
Anatol Belski
9667ee4f72 improve the check, avoid strlen on NULL 2016-08-03 18:26:29 +02:00
Kalle Sommer Nielsen
d5796fb298 Changed the way MAKERNOTE is handled in case we do not have a matching signature (Remi).
Before this patch, exif_process_IFD_in_MAKERNOTE() would return false, then causing the rest of the EXIF parsing to be interrupted. This is a regression from earlier which was most likely a part of a security fix for MAKERNOTE.

The new behavior is to instead of stopping to parse, to continue so we can still fetch data like thumbnail and GPS, thrus allowing yet unsupported formats to parse. If EXIF's debugging mode is enabled, a notice will display in case we do not match against a valid MAKERNOTE signature.

This should temporarily fix bug #72682 (exif_read_data() fails to read all data for some images) until I get around to debug it further.

(cherry picked from commit aabcb5481d)
2016-08-03 17:36:00 +02:00
Anatol Belski
fad3f936ac fix ts build 2016-08-03 12:16:42 +02:00
Christoph M. Becker
f5622f5c87 Fix #72709: imagesetstyle() causes OOB read for empty $styles
Calling imagesetstyle() with an empty $styles array caused gdImageSetStyle()
to be called with `noOfPixels==0`, what could have lead to OOB reads.
Actually, this issue will be fixed in libgd, but to avoid issues when older
libgd is in use, we simply disallow passing an empty $styles array to
imagesetstyle(), what wouldn't serve a useful purpose anyway.
2016-08-02 18:43:37 +02:00
Anatol Belski
40b3a031b2 cleanup table after test 2016-08-02 14:35:24 +02:00
Pablo Santiago Sánchez
90c6cbd09b - lastInsertId using Postgres Lastval() function 2016-08-02 14:34:30 +02:00
Nikita Popov
c9d3ff0c6e Revert "Fixed bug #71219"
This reverts commit 14d674442e.

I misread the discussion on the bug -- this is not the correct
fix. However the other proposed fix does not work either, so just
reverting for now.
2016-07-30 18:34:34 +02:00
Nikita Popov
14d674442e Fixed bug #71219 2016-07-30 18:21:19 +02:00
Nikita Popov
99613431b4 Add missing TSRMLS_FETCH() 2016-07-30 16:28:42 +02:00
Nikita Popov
e87ac688d5 Fixed bug #72142 2016-07-30 15:13:03 +02:00
ju1ius
1d32b80903 fixes bad address given to onig_error_code_to_str
Closes bug #72710

(cherry picked from commit 0fb7eb6723)
2016-07-30 11:46:34 +02:00
Christoph M. Becker
f67ccd4a7b Fix #71894: AddressSanitizer: global-buffer-overflow in zif_cal_from_jd
Julian days < 347998 denote invalid Jewish calendar dates, so
cal_from_jd($jd, CAL_JEWISH) and jdmonthname($jd, CAL_MONTH_JEWISH) should
actually fail. For BC we don't yet let them though, but we fix the OOB read
that happens in this case, and we also adjust cal_from_jd()'s return value
to have empty strings for "abbrevdayname" and "dayname" instead of "Sun"/
"Sunday" and NULL for "dow" instead of 0, which doesn't make any sense.
2016-07-29 01:04:21 +02:00
Christoph M. Becker
5c458c9b02 Implement FR #65462: Please add tests for gregorian and jewish overflow fixes 2016-07-28 19:59:14 +02:00
Christoph M. Becker
7ab39e2fae Fix #67976: cal_days_month() fails for final month of the French calendar
The French calendar ends on 0014-13-05, so trying to calculate the Julian
day of 0015-01-01 fails. We cater to that by returning the hard-coded value.
2016-07-28 19:13:58 +02:00
Christoph M. Becker
c301adbbd1 Fix #72677: SCM_CREDENTIALS related tests should be skipped on AIX
Patch provided by matthieu dot sarter dot external at atos dot net.
2016-07-28 17:19:47 +02:00
Christoph M. Becker
ee6900c3de Fix #72694: mb_ereg_search_setpos does not accept a string's last position
Setting the search position immediately behind the last character should be
allowed, so we fix this off-by-one error.
2016-07-28 15:21:48 +02:00
Christoph M. Becker
56cdaecb28 Fix #72693: mb_ereg_search increments search position when a match zero-width
That's caused by an off-by-one error, which we fix.
2016-07-28 13:57:38 +02:00
Christoph M. Becker
d276e6a838 Fix #72691: mb_ereg_search raises a warning if a match zero-width
That warning doesn't make sense (PCRE doesn't throw such a warning either),
so we remove it.
2016-07-28 13:07:05 +02:00
Pierrick Charron
30a5ed3a79 Fixed bug #71929 (CURLINFO_CERTINFO data parsing error). 2016-07-27 23:30:20 -04:00
Christoph M. Becker
315c0536c2 Fix #72688: preg_match missing group names in matches
We have to multiply with 0x100 to properly scale the high byte.
2016-07-27 18:50:52 +02:00
Christoph M. Becker
cc125f277b Implement #72653: SQLite should allow opening with empty filename
From the [sqlite3_open](https://www.sqlite.org/c3ref/open.html) docs:

| If the filename is an empty string, then a private, temporary on-disk
| database will be created. This private database will be automatically
| deleted as soon as the database connection is closed.

We make that facility available to userland.

While we're at it, we also do some minor optimizations, remove the
unnecessary check for NUL characters in filename, which is already catered
to by ZPP(p), and add a missing `return` in case db_obj isn't initialized.
2016-07-27 16:41:03 +02:00
Ville Hukkamäki
cce457c68c Fix bug #72667
Open data stream after receiving PASV reply, before sending the
main request.

Included test cases for opendir() with ftp:// and ftps:// wrappers.
Test cases re-use ext/ftp/tests/server.inc

Conflicts:
	ext/standard/ftp_fopen_wrapper.c
2016-07-27 15:55:47 +02:00
Pierrick Charron
4c2e1a13be Fixed bug #72684 (AppendIterator segfault with closed generator) 2016-07-26 20:34:16 -04:00
Pierrick Charron
24d8f6ed7c Fixed bug #71709
When curl_setopt is called with an empty slist as value, we should
not add the empty slist to the list of slist to free.
2016-07-26 18:50:15 -04:00
Christoph M. Becker
64e3e932fc Further fixes wrt. bug #72668
Not only SQLite3::querySingle(), but also SQLite3::query() and
SQLite3Stmt::execute() were affected.
2016-07-25 17:03:10 +02:00
Christoph M. Becker
305bddb0ed Fix broken test case
d28f1da introduced a test regression, due to potentially additional output
regarding FreeType support. We fix that by making the test more resilient.
2016-07-25 02:00:37 +02:00
Christoph M. Becker
d28f1dae9d Fix broken test case
The test claims that it would be "checking all the values in returned array",
but due to the use of %a it actually skipped elements. We fix that by using
%s instead.
2016-07-25 00:13:44 +02:00
Anatol Belski
9cd23ff84f regenerate date parser with re2c 0.15.3 2016-07-24 14:50:10 +02:00
Nikita Popov
04b42b1e05 More tolerance in another IntlCalendar test
Again, off-by-1000 is expected if we're late in the second. Add an
extra 1000 to account for actual delta in call times.
2016-07-24 00:15:14 +02:00
Anatol Belski
80fee637f4 fix test 2016-07-23 20:55:39 +02:00
Christoph M. Becker
88838dd282 Fix #68712: suspicious if-else statements 2016-07-23 19:29:43 +02:00
Christoph M. Becker
9fbd0c1ff1 Fix copy&paste errors in gd_interpolation.c
According to <https://github.com/libgd/libgd/commit/f101380>.
2016-07-23 18:09:18 +02:00
Christoph M. Becker
2c16b9cf62 Fix #66555: Always false condition in ext/gd/libgd/gdkanji.c
This issue has already been fixed in libgd[1], so we fix PHP's bundled
libgd accordingly.

[1] <https://github.com/libgd/libgd/commit/aa1d71c>
2016-07-23 16:48:07 +02:00
vhuk
65abdb556d Fix for bug #54431 2016-07-23 13:28:42 +02:00
Nikita Popov
4fc1bfa93b Make IntlCalendar::getNow() test more tolerant
Due to the *1000 factor the two values may be off-by-1000 even
without any actual delay, so increase the check to 2000.
2016-07-22 17:20:56 +02:00
Christoph M. Becker
6b116932b2 Fix #72646: SplFileObject::getCsvControl does not return the escape character
This has obviously been missed when adding the $escape parameter to
SplFileObject::setCsvControl() in PHP 5.3, so we catch up on this.
2016-07-22 15:24:50 +02:00
Christoph M. Becker
f2c2a4be9e Fix #72330: CSV fields incorrectly split if escape char followed by UTF chars
We must not forget to properly reset the state for multibyte characters
following an escape character.
2016-07-21 18:37:24 +02:00
Anatol Belski
b57a38f584 regenerate date parser with re2c 0.13.5 to fix OSX issues 2016-07-20 17:57:39 +02:00
Xinchen Hui
9ebc96116b Fixed arginfo 2016-07-20 18:07:02 +08:00
Derick Rethans
18ba78e988 Regenerate with the -b flag, as we used to do.
Apparently, Apple's LLVM can't handle it otherwise o_O.
2016-07-20 10:19:53 +01:00
Stanislav Malyshev
17a53f9e60 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Improve fix for #72520
2016-07-19 22:37:44 -07:00
Stanislav Malyshev
8ebdb1f5fd Improve fix for #72520 2016-07-19 22:37:03 -07:00
Pierre Joye
e8b768dd92 Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6 2016-07-20 00:18:56 +07:00
Pierre Joye
9cc0a5a9a9 #72482, revert for 5.6 for now 2016-07-20 00:18:25 +07:00
Christoph M. Becker
828f911efd Fix #43828: broken transparency of imagearc for truecolor in blendingmode
No pixel of a filled arc must ever be drawn multiple times. Otherwise we get
artifacts regarding transparency. That happens with the current
implementation of gdImageFilledArc() unless gdChord or gdNoFill are set.
When gdPie is set, however, the filled arc is drawn in wedges, which are
polygons of three points, and so some overlap is natural.

To resolve the issue, we stick with the current algorithm of calculating the
wedges, but instead of drawing each polygon separately, we put the relevant
points in a large array, and draw a single polygon. That also is supposed to
improve the performance considerably.

Note that this modification will change the results when gdImageSetStyle()
or gdImageSetBrush() are used, but we believe that this modification is also
an improvement in this regard, even though it still might not make much
sense to use these functions with gdImageFilledArc().

The respective fix for libgd is
<https://github.com/libgd/libgd/commit/e7e20d6>.
2016-07-19 17:38:26 +02:00
Anatol Belski
bd1919504b fix test portability and expectation
The test images for #72603 and #72618 are broken, that seems to be
the cause of different test output. Seems also to be platform dependent,
so it's not reliable to depend on the exact error output.
2016-07-19 14:49:24 +02:00
Pierre Joye
b25009fc2c #72482, Ilegal write/read access caused by gdImageAALine overflow 2016-07-19 19:34:07 +07:00
Pierre Joye
1d69028d2f fix #72494, improve input color check and prevent issues when old gd are used, done before gd call 2016-07-19 18:23:51 +07:00
Pierre Joye
48e76abadd improve fix #72558, free contribRow as well 2016-07-19 16:33:17 +07:00
Pierre Joye
7521149193 improve fix #72558, while (u>=0) with unsigned int will always be true 2016-07-19 01:56:35 -07:00