Skip to content

A bug with imagerotate() using an angle -27, -90, 90 and 180 #2104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 222 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
cab1c3b
Fixed bug #72479 - same as #72434
smalyshev Jun 27, 2016
7b2c226
Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write…
pierrejoye Jul 4, 2016
ac56700
Update PHP 5.5 NEWS entries with CVE info
kaplanlior Jul 4, 2016
e1ba58f
Fix bug #70480 (php_url_parse_ex() buffer overflow read)
smalyshev Sep 28, 2015
b63d41e
add tests for bug #72512
weltling Jul 6, 2016
c1280db
5.6.25 is next
Tyrael Jul 6, 2016
2b7cd81
merge NEWS blocks
Tyrael Jul 6, 2016
8b905e3
Mask DB usernames from expected test output for test portability
cjbj Jul 7, 2016
bfc4221
add test for bug #72564 (7.x regression)
remicollet Jul 8, 2016
7377f45
Merge branch 'pull-request/1982' into PHP-5.5
Jul 8, 2016
51b584b
Updated NEWS
Jul 8, 2016
0be13d2
fix bug #72024 (microtime() leaks memory)
paresy Jul 7, 2016
78d5783
Backported bug #71144 (Segmentation fault when using cURL with ZTS)
Jul 8, 2016
1071a26
Updated NEWS
Jul 8, 2016
82637e8
Fix #69975: PHP segfaults when accessing nvarchar(max) defined columns
cmb69 Jul 2, 2015
bdf1b22
Updated NEWS
Jul 8, 2016
6fc7817
update filter_var filters for ipv4 addresses to reflect rfc6890
zghosts Jun 24, 2016
51d1989
Updated NEWS
Jul 8, 2016
219ebcb
Fixed bug #70313 PDO statement fails to throw exception
mbeccati Jul 10, 2016
98b9dfa
Fix for HTTP_PROXY issue.
smalyshev Jul 10, 2016
6a5e178
Generate new .c file from .re file, as that was missing on my previou…
derickr Jul 11, 2016
9dd5d96
Remove needless zeroing of anonymously mmap'd memory
mmcco Apr 26, 2016
2552cf2
Remove needless zeroing of anonymously mmap'd memory
Jul 11, 2016
966311e
Bug #66836 has been fixed
cmb69 Jul 11, 2016
7903276
backport to 5.6 (we should not unset the default value)
laruence Jul 12, 2016
f5ccd71
Fix 72122 - don't use EH_THROW for calls to getIterator
lozcalver May 6, 2016
d2d17e1
Updated NEWS
Jul 12, 2016
fb49f13
Fix #72575: using --allow-to-run-as-root should ignore missing user
gooh Jul 11, 2016
403f23b
Updated NEWS
Jul 12, 2016
15336b4
Fixes #52384: Adds parameter value to dumped output. Also adds output…
bishopb Jun 21, 2016
17d4f5c
Updated NEWS
Jul 12, 2016
76e249d
Partially fix #72506: idn_to_ascii for UTS #46 incorrect for long dom…
cmb69 Jul 12, 2016
642e44b
Fix test for #52384
Jul 12, 2016
5cce0d7
Revert "Fix test for #52384"
Jul 12, 2016
8224981
Revert "Fixes #52384: Adds parameter value to dumped output. Also add…
Jul 12, 2016
1896ca4
Updated NEWS
Jul 12, 2016
aca4f65
CS fix and comments with bug ID
smalyshev Jul 13, 2016
a099545
Fix for bug #72513
smalyshev Jul 13, 2016
0218acb
Fix for bug #72513
smalyshev Jul 13, 2016
81406c0
Fix fir bug #72520
smalyshev Jul 13, 2016
aa82e99
Fix bug #72533 (locale_accept_from_http out-of-bounds access)
smalyshev Jul 13, 2016
3798eb6
Fix bug #72562 - destroy var_hash properly
smalyshev Jul 13, 2016
eb190b4
fix: bug72222 for PHP-5.6 reflection export of array consts
nikita2206 May 15, 2016
3cc4265
Add NEWS entry
nikic Jul 13, 2016
8bb3bd0
Fix bug #72596: imagetypes function won't advertise WEBP support
cmb69 Jul 14, 2016
fe1d6fe
Extend libxml exports
weltling Jul 14, 2016
d0c9836
Merge branch 'PHP-5.5' into PHP-5.6
weltling Jul 14, 2016
1c84b55
Fixed bug #72286 (Segmentation fault During Garbage Collection)
dstogov Jul 14, 2016
a4aa4f9
Fix bug #66502: DOM document dangling reference
cmb69 Jul 14, 2016
3666cfa
Fix #72604: imagearc() ignores thickness for full arcs
cmb69 Jul 15, 2016
171c759
Revert "Fixed bug #72286 (Segmentation fault During Garbage Collection)"
nikic Jul 16, 2016
eebcbd5
Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
smalyshev Jul 17, 2016
d1a491a
Fix for bug #72558, Integer overflow error within _gdContributionsAll…
smalyshev Jul 18, 2016
6cb75fb
Fix #70315: 500 Server Error but page is fully rendered
cmb69 Jul 7, 2016
3c3980c
Merge branch 'pull-request/1991' into PHP-5.6
cmb69 Jul 18, 2016
e6c4821
Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simple…
smalyshev Jul 19, 2016
f3feddb
Partial fix for bug #72613 - do not treat negative returns from bz2 a…
smalyshev Jul 19, 2016
41131cd
Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
smalyshev Jul 19, 2016
1364742
Fix tests
smalyshev Jul 19, 2016
08ac37b
Merge branch 'PHP-5.5.38' into PHP-5.5
smalyshev Jul 19, 2016
0fbcff1
fix #72512, invalid read or write for palette image when invalid tran…
pierrejoye Jul 19, 2016
511f07b
Merge branch 'PHP-5.5' into PHP-5.6
pierrejoye Jul 19, 2016
2fbce5f
fix #72519, possible OOB using imagegif
pierrejoye Jul 19, 2016
33c1a55
Apparently some envs miss SIZE_MAX
smalyshev Jul 19, 2016
b61bd12
Merge branch 'PHP-5.5' into PHP-5.6
pierrejoye Jul 19, 2016
7b1572b
fix #72519, possible OOB using imagegif
pierrejoye Jul 19, 2016
928aecc
fix #72512, invalid read or write for palette image when invalid tran…
pierrejoye Jul 19, 2016
8dc5ffa
fix #72519, possible OOB using imagegif
pierrejoye Jul 19, 2016
9bb5f64
Merge branch 'PHP-5.5' into PHP-5.6
weltling Jul 19, 2016
f0a17b3
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
smalyshev Jul 19, 2016
1a88692
Merge branch 'PHP-5.6.24' into PHP-5.6
smalyshev Jul 19, 2016
4d0565b
Merge branch 'PHP-5.5' into PHP-5.6
smalyshev Jul 19, 2016
47d6ea6
Fix memory leak
smalyshev Jul 19, 2016
f69362d
Merge branch 'PHP-5.5' into PHP-5.6
smalyshev Jul 19, 2016
df09515
improve fix #72558, while (u>=0) with unsigned int will always be true
pierrejoye Jul 19, 2016
7521149
improve fix #72558, while (u>=0) with unsigned int will always be true
pierrejoye Jul 19, 2016
894df05
Merge branch 'PHP-5.5' into PHP-5.6
smalyshev Jul 19, 2016
48e76ab
improve fix #72558, free contribRow as well
pierrejoye Jul 19, 2016
834f7a3
Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
pierrejoye Jul 19, 2016
1d69028
fix #72494, improve input color check and prevent issues when old gd …
pierrejoye Jul 19, 2016
b25009f
#72482, Ilegal write/read access caused by gdImageAALine overflow
pierrejoye Jul 19, 2016
bd19195
fix test portability and expectation
weltling Jul 19, 2016
828f911
Fix #43828: broken transparency of imagearc for truecolor in blending…
cmb69 Jul 16, 2016
206d45b
Update NEWS
cmb69 Jul 19, 2016
9cc0a5a
#72482, revert for 5.6 for now
pierrejoye Jul 19, 2016
e8b768d
Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
pierrejoye Jul 19, 2016
8ebdb1f
Improve fix for #72520
smalyshev Jul 20, 2016
17a53f9
Merge branch 'PHP-5.5' into PHP-5.6
smalyshev Jul 20, 2016
18ba78e
Regenerate with the -b flag, as we used to do.
derickr Jul 20, 2016
9ebc961
Fixed arginfo
laruence Jul 20, 2016
b57a38f
regenerate date parser with re2c 0.13.5 to fix OSX issues
weltling Jul 20, 2016
c9f21e8
update NEWs
Tyrael Jul 20, 2016
8b19192
update libs_versions.txt
weltling Jul 20, 2016
f813f43
Removed incorrect (leftover?) sentence in ini
PeeHaa Jul 15, 2016
f2c2a4b
Fix #72330: CSV fields incorrectly split if escape char followed by U…
cmb69 Jul 21, 2016
fb4a6dc
FPM: add test for CVE-2016-5385
remicollet Jul 22, 2016
6b11693
Fix #72646: SplFileObject::getCsvControl does not return the escape c…
cmb69 Jul 22, 2016
4fc1bfa
Make IntlCalendar::getNow() test more tolerant
nikic Jul 22, 2016
65abdb5
Fix for bug #54431
vhuk Jul 21, 2016
2c16b9c
Fix #66555: Always false condition in ext/gd/libgd/gdkanji.c
cmb69 Jul 23, 2016
9fbd0c1
Fix copy&paste errors in gd_interpolation.c
cmb69 Jul 23, 2016
88838dd
Fix #68712: suspicious if-else statements
cmb69 Jul 23, 2016
80fee63
fix test
weltling Jul 23, 2016
04b42b1
More tolerance in another IntlCalendar test
nikic Jul 23, 2016
9cd23ff
regenerate date parser with re2c 0.15.3
weltling Jul 24, 2016
d28f1da
Fix broken test case
cmb69 Jul 24, 2016
305bddb
Fix broken test case
cmb69 Jul 25, 2016
72ac8cf
Enable 'nmake test' on building extensions
y-uti Mar 28, 2016
3f84265
Make phpize use PHP_PREFIX as the default location (windows)
y-uti Mar 26, 2016
0c34d51
update NEWS
weltling Jul 25, 2016
64e3e93
Further fixes wrt. bug #72668
cmb69 Jul 25, 2016
24d8f6e
Fixed bug #71709
adoy Jul 26, 2016
4c2e1a1
Fixed bug #72684 (AppendIterator segfault with closed generator)
adoy Jul 27, 2016
074b86d
Fixed bug #72686 (zlib: url support is broken).
adoy Jul 27, 2016
cce457c
Fix bug #72667
Jul 25, 2016
cc125f2
Implement #72653: SQLite should allow opening with empty filename
cmb69 Jul 27, 2016
315c053
Fix #72688: preg_match missing group names in matches
cmb69 Jul 27, 2016
ed16f2f
Update NEWS
adoy Jul 27, 2016
30a5ed3
Fixed bug #71929 (CURLINFO_CERTINFO data parsing error).
adoy Jul 28, 2016
0ae8c33
Bug #6836 has already been fixed in PHP 5.6.24 and 7.0.9
cmb69 Jul 28, 2016
d276e6a
Fix #72691: mb_ereg_search raises a warning if a match zero-width
cmb69 Jul 28, 2016
56cdaec
Fix #72693: mb_ereg_search increments search position when a match ze…
cmb69 Jul 28, 2016
ee6900c
Fix #72694: mb_ereg_search_setpos does not accept a string's last pos…
cmb69 Jul 28, 2016
6e886f0
Fix #72676: Test cli_process_title_unix fails on AIX
cmb69 Jul 28, 2016
c301adb
Fix #72677: SCM_CREDENTIALS related tests should be skipped on AIX
cmb69 Jul 28, 2016
ced2a80
Bug #69975 had already been fixed as of PHP 5.6.12
cmb69 Jul 28, 2016
7ab39e2
Fix #67976: cal_days_month() fails for final month of the French cale…
cmb69 Jul 28, 2016
5c458c9
Implement FR #65462: Please add tests for gregorian and jewish overfl…
cmb69 Jul 28, 2016
f67ccd4
Fix #71894: AddressSanitizer: global-buffer-overflow in zif_cal_from_jd
cmb69 Jul 28, 2016
1d32b80
fixes bad address given to onig_error_code_to_str
Jul 30, 2016
e87ac68
Fixed bug #72142
nikic Jul 30, 2016
9961343
Add missing TSRMLS_FETCH()
nikic Jul 30, 2016
14d6744
Fixed bug #71219
nikic Jul 30, 2016
c9d3ff0
Revert "Fixed bug #71219"
nikic Jul 30, 2016
90c6cbd
- lastInsertId using Postgres Lastval() function
phackwer Jul 28, 2016
40b3a03
cleanup table after test
weltling Aug 2, 2016
e95625f
update NEWS
weltling Aug 2, 2016
f5622f5
Fix #72709: imagesetstyle() causes OOB read for empty $styles
cmb69 Aug 2, 2016
fad3f93
fix ts build
weltling Aug 3, 2016
67c2b0a
update libs_versions.txt
weltling Aug 3, 2016
d5796fb
Changed the way MAKERNOTE is handled in case we do not have a matchin…
KalleZ Aug 3, 2016
f15c155
update NEWS
weltling Aug 3, 2016
9667ee4
improve the check, avoid strlen on NULL
weltling Aug 3, 2016
562c17e
5.6.26 will be next
Tyrael Aug 3, 2016
4f861b6
Fix bug #72716 - initialize buffer before read
smalyshev Aug 4, 2016
78488a5
Fixed invalid handle error with Implicit Result Sets and bump OCI8 ve…
cjbj Aug 4, 2016
d3a8e10
Clean up FR #72633
mbeccati Aug 4, 2016
a8515a3
Fix broken skip marker in test case
cmb69 Aug 4, 2016
65056e9
Fix #72764
Aug 5, 2016
5e2b834
Check the return value of dbconvert() in mssql_guid_string(), as it m…
KalleZ Aug 6, 2016
3d51b1d
Fix the fix (Nikita), thanks!
KalleZ Aug 6, 2016
40d237d
Fix stream_socket_enable_crypto() test
nikic Aug 7, 2016
243d5fc
Add test for bug #69107: finfo no longer detects PHP files
cmb69 Aug 8, 2016
a38bc7b
Support "git worktree"
Aug 10, 2016
f19578a
Fix URL rewriter partially
Aug 10, 2016
7938ebf
Fix #60665: call to empty() on NULL result using PDO::FETCH_LAZY retu…
cmb69 Aug 12, 2016
ae3b207
Fix #72823: strtr out-of-bound access
cmb69 Aug 13, 2016
82df4e2
Fix #72278: getimagesize returning FALSE on valid jpg
cmb69 Aug 13, 2016
dfadc5a
Bug 70195
singerb Aug 10, 2016
9f1d962
Fixed bug #72787 (json_decode reads out of bounds)
bukka Aug 14, 2016
977cbc2
Fixed bug #72759 Regression in pgo_pgsql
weltling Aug 14, 2016
5c7f802
update NEWS
weltling Aug 14, 2016
4a44227
put missing prototype and fix ts build
weltling Aug 14, 2016
1bb92d5
#72085: SEGV on unknown address zif_xml_parse
cmb69 Aug 16, 2016
448c9be
Fix bug #72663 - destroy broken object when unserializing
smalyshev Aug 2, 2016
8763c60
Fix bug #72681 - consume data even if we're not storing them
smalyshev Aug 3, 2016
da316b5
Fix bug #72708 - php_snmp_parse_oid integer overflow in memory alloca…
smalyshev Aug 4, 2016
f1a0b7d
Update comment
smalyshev Aug 4, 2016
426aeb2
Fix bug #72749: wddx_deserialize allows illegal memory access
smalyshev Aug 4, 2016
95d09e4
Fix bug #70436: Use After Free Vulnerability in unserialize()
smalyshev Aug 7, 2016
639f7fd
Improve fix for #72663
smalyshev Aug 7, 2016
e018ff0
Fix bug #72771: ftps:// opendir wrapper is vulnerable to protocol dow…
smalyshev Aug 7, 2016
698a691
Fix bug #72750: wddx_deserialize null dereference
smalyshev Aug 7, 2016
6dbb1ee
Fixed bug #72627: Memory Leakage In exif_process_IFD_in_TIFF
smalyshev Aug 8, 2016
a3598dd
Fix bug#72697 - select_colors write out-of-bounds
smalyshev Aug 10, 2016
1bd103d
Fix bug #72730 - imagegammacorrect allows arbitrary write access
smalyshev Aug 10, 2016
5a34bd6
Fix for bug #72790 and bug #72799
smalyshev Aug 11, 2016
1cd6bc6
Fix for bug #72807 - do not produce strings with negative length
smalyshev Aug 12, 2016
d6a43a8
Fix bug #72836 - integer overflow in base64_decode caused heap corrup…
smalyshev Aug 15, 2016
cfdeedd
Fix bug #72837 - integer overflow in bzdecompress caused heap corruption
smalyshev Aug 16, 2016
5f91f69
Fix bug #72838 - Integer overflow lead to heap corruption in sql_reg…
smalyshev Aug 16, 2016
24d741d
Fix bug #72848 - integer overflow in quoted_printable_encode caused h…
smalyshev Aug 16, 2016
b9e81e5
Fixed bug #72849 - integer overflow in urlencode
smalyshev Aug 16, 2016
35a8ed2
Fix bug #72850 - integer overflow in uuencode
smalyshev Aug 16, 2016
40bd921
Fix TSRM build
smalyshev Aug 16, 2016
d8b2de1
fix tests
smalyshev Aug 16, 2016
4bf5c31
BLock test with memory leak
smalyshev Aug 17, 2016
9e00ad2
Update NEWS
smalyshev Aug 17, 2016
abe0090
Fixed bug #72853 (stream_set_blocking doesn't work)
laruence Aug 17, 2016
48198e4
Fix #68302: impossible to compile php with zip support
cmb69 Aug 17, 2016
a3159d2
Make tests a little more resilient
cmb69 Aug 17, 2016
54293d2
Skip tests that are supposed to fail due to bugs in old external libgd
cmb69 Aug 17, 2016
b12ac31
Prepare for OCI8 PECL release
cjbj Aug 18, 2016
f2d5305
Add myself as PDO_OCI maintainer
cjbj Aug 18, 2016
761d2f6
fix NEWS
Tyrael Aug 18, 2016
bc1214f
Fix broken test include
cmb69 Aug 18, 2016
ad76e8a
Fix dba configuration for Windows
cmb69 Aug 19, 2016
057278b
Revert "Fix dba configuration for Windows"
cmb69 Aug 19, 2016
21f08a7
Fixed bug #72852 imap_mail null dereference
weltling Aug 19, 2016
f682193
update NEWS
weltling Aug 19, 2016
9164dc1
Fix #72714: _xml_startElementHandler() segmentation fault
cmb69 Aug 16, 2016
e4a006c
Fix #65732: grapheme_*() is not Unicode compliant on CR LF sequence
cmb69 Aug 19, 2016
52793c1
Improvements to fix #72714, suggested by nikic
cmb69 Aug 20, 2016
b740bb3
Fixed bug #72907 (null pointer deref, segfault in gc_remove_zval_from…
laruence Aug 21, 2016
226e21b
Merge branch 'PHP-5.6' of git.php.net:/php-src into PHP-5.6
laruence Aug 21, 2016
9eb5bbd
Fix #66005: imagecopy does not support 1bit transparency on truecolor…
cmb69 Aug 21, 2016
d65adac
Fix #72913: imagecopy() loses single-color transparency on palette im…
cmb69 Aug 21, 2016
6a232c3
Fix #68716: possible resource leaks in _php_image_convert()
cmb69 Aug 21, 2016
a1ff39f
backport relevant part from bug #72858 patch in 7.0
weltling Aug 25, 2016
bd8112a
Fix #71514: Bad dba_replace condition because of wrong API usage
cmb69 Aug 25, 2016
84512a1
Fix #70825: Cannot fetch multiple values with group in ini file
cmb69 Aug 25, 2016
2139918
Fix #65550: get_browser() incorrectly parsers entries with "+" sign
cmb69 Aug 26, 2016
c73bcbe
Added .user.ini support.
Aug 29, 2016
e2609a3
fix leak
weltling Aug 29, 2016
1a840b9
fix double free
weltling Aug 29, 2016
295303b
Fixed bug #72703 Out of bounds global memory read in BF_crypt trigger…
weltling Aug 29, 2016
d787b0e
ensure null termination
weltling Aug 29, 2016
ae81e8f
update NEWS
weltling Aug 29, 2016
c7b4cd1
fix HANDLE leak
weltling Aug 29, 2016
207dab5
Fix #71882: Negative ftruncate() on php://memory exhausts memory
cmb69 Aug 29, 2016
af7828a
Test case for bug #72771
Aug 19, 2016
2f10db3
Fix #66797: mb_substr only takes 32-bit signed integer
cmb69 Aug 30, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EXTENSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ STATUS: Working
SINCE: 5.1
-------------------------------------------------------------------------------
EXTENSION: pdo_oci
PRIMARY MAINTAINER: Unknown
PRIMARY MAINTAINER: Christopher Jones <sixd@php.net>
MAINTENANCE: Odd fixes
STATUS: Working
SINCE: 5.1
Expand Down
363 changes: 296 additions & 67 deletions NEWS

Large diffs are not rendered by default.

20 changes: 18 additions & 2 deletions TSRM/tsrm_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,12 @@ TSRM_API int shmget(int key, int size, int flags)
}
} else {
if (flags & IPC_EXCL) {
if (shm_handle) {
CloseHandle(shm_handle);
}
if (info_handle) {
CloseHandle(info_handle);
}
return -1;
}
}
Expand Down Expand Up @@ -654,17 +660,27 @@ TSRM_API int shmget(int key, int size, int flags)
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
{
shm_pair *shm = shm_get(key, NULL);
int err;

if (!shm->segment) {
return (void*)-1;
}

shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);

err = GetLastError();
if (err) {
/* Catch more errors */
if (ERROR_NOT_ENOUGH_MEMORY == err) {
_set_errno(ENOMEM);
}
return (void*)-1;
}

shm->descriptor->shm_atime = time(NULL);
shm->descriptor->shm_lpid = getpid();
shm->descriptor->shm_nattch++;

shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);

return shm->addr;
}

Expand Down
6 changes: 6 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ PHP 5.6 UPGRADE NOTES
. CURLOPT_KRBLEVEL
. CURLOPT_KRB4LEVEL

curl_getinfo($ch, CURLINFO_CERTINFO) returns certificate Subject and Issuer
as a string (PHP >= 5.6.25)

- Strings:
substr_compare() now allows $length to be zero.
pack() and unpack() now support 64-bit format specifiers: q, Q, J and P.
Expand Down Expand Up @@ -400,6 +403,9 @@ PHP 5.6 UPGRADE NOTES
- CURL:
CURL_HTTP_VERSION_2_0 and CURL_VERSION_HTTP2 (>= 5.6.8)

- GD:
IMG_WEBP (>= 5.6.25)

- LDAP:
LDAP_ESCAPE_FILTER int(1)
LDAP_ESCAPE_DN int(2)
Expand Down
18 changes: 18 additions & 0 deletions Zend/tests/bug72907.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
Bug #72907 (null pointer deref, segfault in gc_remove_zval_from_buffer (zend_gc.c:260))
--FILE--
<?php

$a = 0;

($a->a = &$E) + ($b = $a->b->i -= 0);

?>
--EXPECTF--
Warning: Attempt to modify property of non-object in %sbug72907.php on line %d

Warning: Attempt to modify property of non-object in %sbug72907.php on line %d

Warning: Creating default object from empty value in %sbug72907.php on line %d

Notice: Undefined property: stdClass::$i in %sbug72907.php on line %d
7 changes: 5 additions & 2 deletions Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ ZEND_API int add_property_zval_ex(zval *arg, const char *key, uint key_len, zval
#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
#define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)


ZEND_API int call_user_function(HashTable *function_table, zval **object_pp, zval *function_name, zval *retval_ptr, zend_uint param_count, zval *params[] TSRMLS_DC);
Expand All @@ -458,7 +458,7 @@ ZEND_API extern const zend_fcall_info_cache empty_fcall_info_cache;

/** Build zend_call_info/cache from a zval*
*
* Caller is responsible to provide a return value, otherwise the we will crash.
* Caller is responsible to provide a return value, otherwise the we will crash.
* fci->retval_ptr_ptr = NULL;
* In order to pass parameters the following members need to be set:
* fci->param_count = 0;
Expand Down Expand Up @@ -578,6 +578,9 @@ END_EXTERN_C()
const char *__s=(s); \
zval *__z = (z); \
Z_STRLEN_P(__z) = strlen(__s); \
if (UNEXPECTED(Z_STRLEN_P(__z) < 0)) { \
zend_error(E_ERROR, "String size overflow"); \
} \
Z_STRVAL_P(__z) = (duplicate?estrndup(__s, Z_STRLEN_P(__z)):(char*)__s);\
Z_TYPE_P(__z) = IS_STRING; \
} while (0)
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ ZEND_METHOD(exception, __construct)
Exception unserialize checks */
#define CHECK_EXC_TYPE(name, type) \
value = zend_read_property(default_exception_ce, object, name, sizeof(name)-1, 0 TSRMLS_CC); \
if(value && Z_TYPE_P(value) != type) { \
if (value && Z_TYPE_P(value) != IS_NULL && Z_TYPE_P(value) != type) { \
zval *tmp; \
MAKE_STD_ZVAL(tmp); \
ZVAL_STRINGL(tmp, name, sizeof(name)-1, 1); \
Expand Down
4 changes: 1 addition & 3 deletions Zend/zend_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,9 +522,7 @@ static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **va
zval *variable_ptr = *variable_ptr_ptr;
zval *value_ptr = *value_ptr_ptr;

if (variable_ptr == &EG(error_zval) || value_ptr == &EG(error_zval)) {
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
} else if (variable_ptr != value_ptr) {
if (variable_ptr != value_ptr) {
if (!PZVAL_IS_REF(value_ptr)) {
/* break it away */
Z_DELREF_P(value_ptr);
Expand Down
8 changes: 4 additions & 4 deletions Zend/zend_virtual_cwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,14 +651,14 @@ CWD_API void realpath_cache_del(const char *path, int path_len TSRMLS_DC) /* {{{
memcmp(path, (*bucket)->path, path_len) == 0) {
realpath_cache_bucket *r = *bucket;
*bucket = (*bucket)->next;

/* if the pointers match then only subtract the length of the path */
if(r->path == r->realpath) {
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
} else {
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1 + r->realpath_len + 1;
}

free(r);
return;
} else {
Expand Down Expand Up @@ -734,7 +734,7 @@ static inline realpath_cache_bucket* realpath_cache_find(const char *path, int p
realpath_cache_bucket *r = *bucket;
*bucket = (*bucket)->next;

/* if the pointers match then only subtract the length of the path */
/* if the pointers match then only subtract the length of the path */
if(r->path == r->realpath) {
CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + r->path_len + 1;
} else {
Expand Down Expand Up @@ -1190,7 +1190,7 @@ CWD_API int virtual_file_ex(cwd_state *state, const char *path, verify_path_func
int add_slash;
void *tmp;

if (path_length == 0 || path_length >= MAXPATHLEN-1) {
if (path_length <= 0 || path_length >= MAXPATHLEN-1) {
#ifdef TSRM_WIN32
# if _MSC_VER < 1300
errno = EINVAL;
Expand Down
13 changes: 8 additions & 5 deletions Zend/zend_vm_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -1817,11 +1817,14 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
if ((OP2_TYPE == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
(OP1_TYPE == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);

if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
Z_DELREF_PP(variable_ptr_ptr);
} else if ((OP2_TYPE == IS_VAR && UNEXPECTED(*value_ptr_ptr == &EG(error_zval))) ||
(OP1_TYPE == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval)))) {
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
} else {
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
if (OP2_TYPE == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
Z_DELREF_PP(variable_ptr_ptr);
}
}

if (RETURN_VALUE_USED(opline)) {
Expand Down
52 changes: 32 additions & 20 deletions Zend/zend_vm_execute.h
Original file line number Diff line number Diff line change
Expand Up @@ -20408,11 +20408,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL
if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
(IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);

if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
Z_DELREF_PP(variable_ptr_ptr);
} else if ((IS_VAR == IS_VAR && UNEXPECTED(*value_ptr_ptr == &EG(error_zval))) ||
(IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval)))) {
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
} else {
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
Z_DELREF_PP(variable_ptr_ptr);
}
}

if (RETURN_VALUE_USED(opline)) {
Expand Down Expand Up @@ -23903,11 +23906,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE
if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
(IS_VAR == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);

if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
Z_DELREF_PP(variable_ptr_ptr);
} else if ((IS_CV == IS_VAR && UNEXPECTED(*value_ptr_ptr == &EG(error_zval))) ||
(IS_VAR == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval)))) {
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
} else {
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
Z_DELREF_PP(variable_ptr_ptr);
}
}

if (RETURN_VALUE_USED(opline)) {
Expand Down Expand Up @@ -37721,11 +37727,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE
if ((IS_VAR == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
(IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);

if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
Z_DELREF_PP(variable_ptr_ptr);
} else if ((IS_VAR == IS_VAR && UNEXPECTED(*value_ptr_ptr == &EG(error_zval))) ||
(IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval)))) {
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
} else {
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
if (IS_VAR == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
Z_DELREF_PP(variable_ptr_ptr);
}
}

if (RETURN_VALUE_USED(opline)) {
Expand Down Expand Up @@ -40929,11 +40938,14 @@ static int ZEND_FASTCALL ZEND_ASSIGN_REF_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER
if ((IS_CV == IS_VAR && UNEXPECTED(value_ptr_ptr == NULL)) ||
(IS_CV == IS_VAR && UNEXPECTED(variable_ptr_ptr == NULL))) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets nor overloaded objects");
}
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);

if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
Z_DELREF_PP(variable_ptr_ptr);
} else if ((IS_CV == IS_VAR && UNEXPECTED(*value_ptr_ptr == &EG(error_zval))) ||
(IS_CV == IS_VAR && UNEXPECTED(*variable_ptr_ptr == &EG(error_zval)))) {
variable_ptr_ptr = &EG(uninitialized_zval_ptr);
} else {
zend_assign_to_variable_reference(variable_ptr_ptr, value_ptr_ptr TSRMLS_CC);
if (IS_CV == IS_VAR && opline->extended_value == ZEND_RETURNS_NEW) {
Z_DELREF_PP(variable_ptr_ptr);
}
}

if (RETURN_VALUE_USED(opline)) {
Expand Down
4 changes: 2 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);

PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=6
PHP_RELEASE_VERSION=24
PHP_EXTRA_VERSION="RC1"
PHP_RELEASE_VERSION=26
PHP_EXTRA_VERSION="-dev"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`

Expand Down
Loading