Skip to content

String size refactor take 2 ext/standard last wave #6

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
b980e4f
Fixed #65225: PHP_BINARY incorrectly set
patrickallaert Jul 9, 2013
19312fa
Fixbug: phpize --clean will delete include/*.h
matyhtf Aug 12, 2013
060fadc
fix cve number
smalyshev Aug 16, 2013
5788797
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 16, 2013
991f011
Merge branch 'PHP-5.5'
smalyshev Aug 16, 2013
0ebef46
With --enable-dtrace, the correct PIC/non-PIC .o files on Solaris and
cjbj Aug 16, 2013
4b4ffaf
Merge branch 'PHP-5.4' into PHP-5.5
cjbj Aug 16, 2013
2251e43
Merge branch 'PHP-5.5'
cjbj Aug 16, 2013
6993ca5
Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into…
cjbj Aug 16, 2013
1eadd15
Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into…
cjbj Aug 16, 2013
8807726
Merge branch 'master' of https://git.php.net/repository/php-src
cjbj Aug 16, 2013
cb539b3
Update NEWS
cjbj Aug 16, 2013
7237c31
Merge branch 'PHP-5.4' into PHP-5.5
cjbj Aug 16, 2013
60c8d81
Update NEWS
cjbj Aug 16, 2013
c04d140
Merge branch 'PHP-5.5'
cjbj Aug 16, 2013
4734b31
merge news for 5.5.2
smalyshev Aug 16, 2013
94cd406
Merge branch 'PHP-5.5'
smalyshev Aug 16, 2013
466584f
fix typo
smalyshev Aug 16, 2013
a42e87d
Merge branch 'PHP-5.5'
smalyshev Aug 16, 2013
a6f596f
Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into…
cjbj Aug 16, 2013
0c4ba51
Merge branch 'master' of https://git.php.net/repository/php-src
cjbj Aug 16, 2013
803045e
Fix duplicated 5.5.2 NEWS in my tree
cjbj Aug 16, 2013
7e7a8f0
Use pkg-config to detect iodbc
olemarkus Aug 17, 2013
83e251a
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
Aug 18, 2013
b6c14af
Merge branch 'master' of git.php.net:php-src
Aug 18, 2013
e960eeb
Revise pgsql tests
Aug 18, 2013
acda3da
Create test to the extension xmlrpc
Aug 18, 2013
144eab0
code related typo fixes
vlajos Jul 23, 2013
03b2603
Merge branch 'PHP-5.5'
smalyshev Aug 18, 2013
6251525
Merge branch 'pull-request/405'
smalyshev Aug 18, 2013
4a0e87e
Fixbug: phpize --clean will delete include/*.h
matyhtf Aug 12, 2013
296a434
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 18, 2013
5786e77
Merge branch 'PHP-5.5'
smalyshev Aug 18, 2013
ac2d2b9
Create test to the extension xmlrpc
Aug 18, 2013
3da2fb3
Add -P option to use the current binary
smalyshev Aug 18, 2013
f4da131
Merge branch 'pull-request/412'
smalyshev Aug 18, 2013
2ee7e12
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 18, 2013
958ee39
Merge branch 'PHP-5.5'
smalyshev Aug 18, 2013
8845262
Merge branch 'pull-request/411'
smalyshev Aug 18, 2013
a3fa25e
Use pkg-config to detect iodbc
olemarkus Aug 17, 2013
1794291
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 18, 2013
756ce65
Merge branch 'PHP-5.5'
smalyshev Aug 18, 2013
98d29d2
Fixed #65225: PHP_BINARY incorrectly set
patrickallaert Jul 9, 2013
0154db1
new for fix #65225
smalyshev Aug 18, 2013
4fbce67
Merge branch 'pull-request/381'
smalyshev Aug 18, 2013
bf0c6f2
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 18, 2013
4bc6e06
Merge branch 'PHP-5.5'
smalyshev Aug 18, 2013
b33a1a1
add CVE-2011-4718
smalyshev Aug 18, 2013
33e9c02
Merge branch 'PHP-5.5'
smalyshev Aug 18, 2013
47678c0
https://bugs.php.net/bug.php?id=64979
marcelaraujo Jun 21, 2013
2652247
Use in preg_replace_callback() using variables by reference and test …
marcelaraujo Jun 22, 2013
42214b6
Merge branch 'PHP-5.5'
smalyshev Aug 18, 2013
9973658
Fix for php bug #64802 includes test case
mk-j Aug 14, 2013
bd29ff7
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 18, 2013
12c2a8a
Merge branch 'PHP-5.5'
smalyshev Aug 18, 2013
14f5732
Fix bug #65470 Segmentation fault in zend_error() with --enable-dtrace
smalyshev Aug 19, 2013
bcf785f
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 19, 2013
ecd67ed
Merge branch 'PHP-5.5'
smalyshev Aug 19, 2013
c1c49d6
fix using wrong buffer pointer
smalyshev Aug 19, 2013
cf96aa1
Merge branch 'PHP-5.3' into PHP-5.4
smalyshev Aug 19, 2013
8e0f110
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 19, 2013
cfe5833
Merge branch 'PHP-5.5'
smalyshev Aug 19, 2013
4bad49e
added new glob() test
weltling Aug 19, 2013
cdc64f0
Merge branch 'PHP-5.4' into PHP-5.5
weltling Aug 19, 2013
6c570ad
Merge branch 'PHP-5.5'
weltling Aug 19, 2013
f61b648
modified the new glob() test for master
weltling Aug 19, 2013
f4df401
fixed glob() edge case on windows, ref bug #47358
weltling Aug 19, 2013
7a79cf0
Fixed bug #64503 (Compilation fails with error: conflicting types for…
laruence Mar 25, 2013
4ea9729
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 19, 2013
71c24f4
Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into…
cjbj Aug 19, 2013
ca57ce5
Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into…
cjbj Aug 19, 2013
bd7d7a2
Merge branch 'master' of https://git.php.net/repository/php-src
cjbj Aug 19, 2013
a486250
Fixed bug #64503 (Compilation fails with error: conflicting types for…
laruence Mar 25, 2013
d0beb7d
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
smalyshev Aug 19, 2013
d2c78c9
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 19, 2013
d17ade1
Merge branch 'PHP-5.5'
smalyshev Aug 19, 2013
aa7d3d8
Track created curl_slist structs by option so they can be updated in …
LawnGnome Aug 19, 2013
69f12ad
Merge branch 'PHP-5.4' into PHP-5.5
LawnGnome Aug 19, 2013
2a46fc0
Merge branch 'PHP-5.5'
LawnGnome Aug 19, 2013
1ac4d8f
fix bug #65481 (shutdown segfault due to serialize)
m6w6 Jul 29, 2013
9d2cdac
Merge branch 'PHP-5.4' into PHP-5.5
m6w6 Aug 19, 2013
73cd2e0
Merge branch 'PHP-5.5'
m6w6 Aug 19, 2013
c60067c
Update NEWS
cjbj Aug 20, 2013
4ee1ec4
Update NEWS
cjbj Aug 20, 2013
d5979c8
Reduce (some more) compile noise of 'unused variable' and 'may be used
cjbj Aug 20, 2013
19476f5
Merge branch 'PHP-5.5'
cjbj Aug 20, 2013
279b4fe
Remove compile warning "variable ‘mekeylen’ set but not used"
cjbj Aug 20, 2013
cf7f507
Remove compile warnings:
cjbj Aug 20, 2013
f69a5c5
Remove compile warning: variable ‘streamp’ set but not used [-Wunused…
cjbj Aug 20, 2013
8346947
Remove compile warnings:
cjbj Aug 20, 2013
5697aa5
Merge branch 'PHP-5.5'
cjbj Aug 20, 2013
dc384a5
Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into…
cjbj Aug 20, 2013
33ff441
Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into…
cjbj Aug 20, 2013
682c28c
Merge branch 'master' of https://git.php.net/repository/php-src
cjbj Aug 20, 2013
1a00b9b
Remove compile warning:
cjbj Aug 20, 2013
24288eb
Merge branch 'PHP-5.5'
cjbj Aug 20, 2013
ee7f6e7
Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into…
cjbj Aug 20, 2013
902c302
Merge branch 'master' of https://git.php.net/repository/php-src
cjbj Aug 20, 2013
7d538cf
Fixed test bug
Aug 20, 2013
d487f5e
bump version
smalyshev Aug 20, 2013
53d9643
Merge branch 'PHP-5.4' into PHP-5.5
smalyshev Aug 20, 2013
a52b8fe
Merge branch 'PHP-5.5'
smalyshev Aug 20, 2013
fdef0e3
Revert wrong description
Aug 20, 2013
117bd08
Merge branch 'master' of git.php.net:php-src
Aug 20, 2013
36122c7
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
Aug 20, 2013
4cd9796
Add session.use_strict_mode description to php.ini-*
Aug 20, 2013
8da7aa7
Merge branch 'PHP-5.5'
Aug 20, 2013
827100d
split the glob() test to test different basedir
weltling Aug 20, 2013
72d1ec8
Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into…
cjbj Aug 20, 2013
f32c0ef
Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into…
cjbj Aug 20, 2013
96d435f
Merge branch 'master' of https://git.php.net/repository/php-src
cjbj Aug 20, 2013
27c803a
Fix bug #64953 (Postgres prepared statement positional parameter cast…
m6w6 Aug 20, 2013
7f3e7eb
Merge branch 'PHP-5.4' into PHP-5.5
m6w6 Aug 20, 2013
90218e8
Merge branch 'PHP-5.5'
m6w6 Aug 20, 2013
b455ba9
Remove some compilation warnings:
cjbj Aug 20, 2013
7160adf
Merge branch 'PHP-5.4' into PHP-5.5
cjbj Aug 20, 2013
8d614dc
Merge branch 'PHP-5.5'
cjbj Aug 20, 2013
eba85f9
Eliminate compiler warnings "warning: pointer targets in initializati…
cjbj Aug 20, 2013
d82f933
Eliminate compiler warnings: "warning: pointer targets in initializat…
cjbj Aug 20, 2013
0ab8475
Merge branch 'PHP-5.4' into PHP-5.5
cjbj Aug 20, 2013
db0166a
Tabify
cjbj Aug 20, 2013
0e56277
Merge branch 'PHP-5.5'
cjbj Aug 20, 2013
dfb1877
Fix compile warning "intl_cppshims.h:34:7: warning: no newline at end…
cjbj Aug 20, 2013
8457636
Merge branch 'PHP-5.5'
cjbj Aug 20, 2013
ec3f8d2
Remove compilation warnings: "warning: no newline at end of file"
cjbj Aug 20, 2013
4883fc5
Merge branch 'PHP-5.5'
cjbj Aug 20, 2013
433225a
Remove compilation warning "warning: no newline at end of file"
cjbj Aug 20, 2013
77f5caa
Merge branch 'PHP-5.5'
cjbj Aug 20, 2013
9c9fee3
Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into…
cjbj Aug 20, 2013
9e1e009
Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into…
cjbj Aug 20, 2013
92b946b
Merge branch 'master' of https://git.php.net/repository/php-src
cjbj Aug 20, 2013
e9b12be
Quash compile warning "warning: 'flags' may be used uninitialized in …
cjbj Aug 20, 2013
268c288
Merge branch 'PHP-5.4' into PHP-5.5
cjbj Aug 20, 2013
89c4aba
Merge branch 'PHP-5.5'
cjbj Aug 20, 2013
1641158
Fixed Bug #65475
Aug 20, 2013
d2a99a7
Fixed Bug #65475
Aug 20, 2013
7318b85
Update NEWS
Aug 21, 2013
c51f77f
Add php_serialize session.serialize_handler. This patch closes
Aug 21, 2013
aaf95aa
Merge branch 'PHP-5.5'
Aug 21, 2013
7be3c74
Update NEWS
Aug 21, 2013
c8acebe
fixed str_split()
weltling Aug 21, 2013
d871982
Merge branch 'string_size_refactor_take_2' of https://github.com/ircm…
weltling Aug 21, 2013
e2070d1
Merge branch 'master' of https://github.com/php/php-src into string_s…
weltling Aug 21, 2013
d6c59e1
lost condition
weltling Aug 21, 2013
2d44a04
fixed str_pad()
weltling Aug 21, 2013
5c06e5c
Fixed compiler warning
mbeccati Aug 21, 2013
696852f
Fixed other compiler warnings in PDO_PGSQL
mbeccati Aug 21, 2013
540f325
Fixed compiler warnings in ext/pgsql
mbeccati Aug 21, 2013
4283f75
Merge branch 'PHP-5.4' into PHP-5.5
mbeccati Aug 21, 2013
3ec28b1
Merge branch 'PHP-5.5'
mbeccati Aug 21, 2013
c8fbe07
fixed unpack()
weltling Aug 21, 2013
bda11c6
partial fix to hebrev
weltling Aug 21, 2013
83e3466
Fix return types of password API helper functions.
ircmaxell Aug 21, 2013
90b489f
Merge branch 'PHP-5.5'
ircmaxell Aug 21, 2013
d8023d1
Fix pointer sign warning showing up in EVERY build
m6w6 Aug 21, 2013
6181948
Merge branch 'PHP-5.4' into PHP-5.5
m6w6 Aug 21, 2013
4abee37
Merge branch 'PHP-5.5'
m6w6 Aug 21, 2013
d85827f
Reduce compilation noise during normal compilation:
cjbj Aug 21, 2013
d9bfe06
Merge branch 'PHP-5.5'
cjbj Aug 21, 2013
f38bd22
Suppress compliation warning "warning: passing argument 1 of ‘_efree’…
cjbj Aug 21, 2013
9895e8b
Merge branch 'PHP-5.4' into PHP-5.5
cjbj Aug 21, 2013
71ba571
Merge branch 'PHP-5.5'
cjbj Aug 21, 2013
d0bede2
Merge branch 'PHP-5.4' of https://git.php.net/repository/php-src into…
cjbj Aug 21, 2013
d2a2e94
Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into…
cjbj Aug 21, 2013
0b60f32
Merge branch 'master' of https://git.php.net/repository/php-src
cjbj Aug 21, 2013
1af111d
Suppress compiler warning "warning: variable ‘retcount’ set but not u…
cjbj Aug 21, 2013
54d4a28
Suppress compiler warning "warning: variable ‘length’ set but not use…
cjbj Aug 21, 2013
11087ee
Merge branch 'PHP-5.4' into PHP-5.5
cjbj Aug 21, 2013
9507fcf
Merge branch 'PHP-5.5'
cjbj Aug 21, 2013
09c3b6c
fixed "s" vs "S" for soundex
weltling Aug 22, 2013
ea56c2d
fixed fwrite
weltling Aug 22, 2013
5c6428b
fixed file_put_contents()
weltling Aug 22, 2013
764054c
Merge branch 'master' of https://github.com/php/php-src into string_s…
weltling Aug 22, 2013
569cbd2
fix build
weltling Aug 22, 2013
5351aa9
Merge branch 'string_size_refactor_take_2' of https://github.com/welt…
weltling Aug 22, 2013
bfb0e87
final fix for hebrev()
weltling Aug 22, 2013
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
32 changes: 32 additions & 0 deletions Zend/tests/bug64979.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
--TEST--
Bug #64578 (Closures with static variables can be generators)
--XFAIL--
Bug #64979 not fixed yet.
--FILE--
<?php

function new_closure_gen() {
return function() {
static $foo = 0;
yield ++$foo;
};
}

$closure1 = new_closure_gen();
$closure2 = new_closure_gen();

$gen1 = $closure1();
$gen2 = $closure1();
$gen3 = $closure2();

foreach (array($gen1, $gen2, $gen3) as $gen) {
foreach ($gen as $val) {
print "$val\n";
}
}

?>
--EXPECT--
int(1)
int(2)
int(1)
26 changes: 26 additions & 0 deletions Zend/tests/closure_047.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--TEST--
Closure 047: Use in preg_replace_callback() using variables by reference
--FILE--
<?php

function replace_variables($text, $params) {

preg_replace_callback( '/(\?)/', function($matches) use (&$params, &$text) {

$text = preg_replace( '/(\?)/', array_shift( $params ), $text, 1 );

}, $text );

return $text;
}

echo replace_variables('a=?', array('0')) . "\n";
echo replace_variables('a=?, b=?', array('0', '1')) . "\n";
echo replace_variables('a=?, b=?, c=?', array('0', '1', '2')) . "\n";
echo "Done\n";
?>
--EXPECT--
a=0
a=0, b=1
a=0, b=1, c=2
Done
26 changes: 26 additions & 0 deletions Zend/tests/closure_048.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--TEST--
Closure 048: Use in preg_replace_callback() using variables by reference
--FILE--
<?php

function replace_variables($text, $params) {

$c = function($matches) use (&$params, &$text) {
$text = preg_replace( '/(\?)/', array_shift( $params ), $text, 1 );
};

preg_replace_callback( '/(\?)/', $c, $text );

return $text;
}

echo replace_variables('a=?', array('0')) . "\n";
echo replace_variables('a=?, b=?', array('0', '1')) . "\n";
echo replace_variables('a=?, b=?, c=?', array('0', '1', '2')) . "\n";
echo "Done\n";
?>
--EXPECT--
a=0
a=0, b=1
a=0, b=1, c=2
Done
6 changes: 4 additions & 2 deletions Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,17 +1092,19 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
error_filename = "Unknown";
}

va_start(args, format);

#ifdef HAVE_DTRACE
if(DTRACE_ERROR_ENABLED()) {
char *dtrace_error_buffer;
va_start(args, format);
zend_vspprintf(&dtrace_error_buffer, 0, format, args);
DTRACE_ERROR(dtrace_error_buffer, (char *)error_filename, error_lineno);
efree(dtrace_error_buffer);
va_end(args);
}
#endif /* HAVE_DTRACE */

va_start(args, format);

/* if we don't have a user defined error handler */
if (!EG(user_error_handler)
|| !(EG(user_error_handler_error_reporting) & type)
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void clean_non_persistent_constants(TSRMLS_D)
}
}

ZEND_API void zend_register_null_constant(const char *name, uint name_len, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_null_constant(const char *name, zend_str_size_uint name_len, int flags, int module_number TSRMLS_DC)
{
zend_constant c;

Expand All @@ -157,7 +157,7 @@ ZEND_API void zend_register_null_constant(const char *name, uint name_len, int f
zend_register_constant(&c TSRMLS_CC);
}

ZEND_API void zend_register_bool_constant(const char *name, uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC)
ZEND_API void zend_register_bool_constant(const char *name, zend_str_size_uint name_len, zend_bool bval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;

Expand Down
42 changes: 38 additions & 4 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2925,17 +2925,17 @@ dnl providerdesc
dnl header-file
ac_hdrobj=$2

dnl Add providerdesc.o into global objects when needed
dnl Add providerdesc.o or .lo into global objects when needed
case $host_alias in
*freebsd*)
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
PHP_LDFLAGS="$PHP_LDFLAGS -lelf"
;;
*solaris*)
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
;;
*linux*)
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.o"
PHP_GLOBAL_OBJS="[$]PHP_GLOBAL_OBJS [$]ac_bdir[$]ac_provsrc.lo"
;;
esac

Expand Down Expand Up @@ -2969,14 +2969,48 @@ dnl in GNU Make which causes the .d file to be overwritten (Bug 61268)
$abs_srcdir/$ac_provsrc:;

$ac_bdir[$]ac_hdrobj: $abs_srcdir/$ac_provsrc
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -h -C -s $ac_srcdir[$]ac_provsrc -o \$[]@.bak && \$(SED) -e 's,PHP_,DTRACE_,g' \$[]@.bak > \$[]@

\$(PHP_DTRACE_OBJS): $ac_bdir[$]ac_hdrobj

EOF

case $host_alias in
*solaris*|*linux*)
dtrace_prov_name="`echo $ac_provsrc | $SED -e 's#\(.*\)\/##'`.o"
dtrace_lib_dir="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/[^/]*#\1#'`/.libs"
dtrace_d_obj="`echo $ac_bdir[$]ac_provsrc | $SED -e 's#\(.*\)/\([^/]*\)#\1/.libs/\2#'`.o"
dtrace_nolib_objs='$(PHP_DTRACE_OBJS:.lo=.o)'
for ac_lo in $PHP_DTRACE_OBJS; do
dtrace_lib_objs="[$]dtrace_lib_objs `echo $ac_lo | $SED -e 's,\.lo$,.o,' -e 's#\(.*\)\/#\1\/.libs\/#'`"
done;
dnl Always attempt to create both PIC and non-PIC DTrace objects (Bug 63692)
cat>>Makefile.objects<<EOF
$ac_bdir[$]ac_provsrc.lo: \$(PHP_DTRACE_OBJS)
echo "[#] Generated by Makefile for libtool" > \$[]@
@test -d "$dtrace_lib_dir" || mkdir $dtrace_lib_dir
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $dtrace_d_obj -s $abs_srcdir/$ac_provsrc $dtrace_lib_objs 2> /dev/null && test -f "$dtrace_d_obj"; then [\\]
echo "pic_object=['].libs/$dtrace_prov_name[']" >> \$[]@ [;\\]
else [\\]
echo "pic_object='none'" >> \$[]@ [;\\]
fi
if CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o $ac_bdir[$]ac_provsrc.o -s $abs_srcdir/$ac_provsrc $dtrace_nolib_objs 2> /dev/null && test -f "$ac_bdir[$]ac_provsrc.o"; then [\\]
echo "non_pic_object=[']$dtrace_prov_name[']" >> \$[]@ [;\\]
else [\\]
echo "non_pic_object='none'" >> \$[]@ [;\\]
fi

EOF

;;
*)
cat>>Makefile.objects<<EOF
$ac_bdir[$]ac_provsrc.o: \$(PHP_DTRACE_OBJS)
CFLAGS="\$(CFLAGS_CLEAN)" dtrace -G -o \$[]@ -s $abs_srcdir/$ac_provsrc $dtrace_objs

EOF
;;
esac
])

dnl
Expand Down
2 changes: 0 additions & 2 deletions ext/bz2/bz2_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,13 @@ static php_stream_filter_status_t php_bz2_compress_filter(
size_t consumed = 0;
int status;
php_stream_filter_status_t exit_status = PSFS_FEED_ME;
bz_stream *streamp;

if (!thisfilter || !thisfilter->abstract) {
/* Should never happen */
return PSFS_ERR_FATAL;
}

data = (php_bz2_filter_data *)(thisfilter->abstract);
streamp = &(data->strm);

while (buckets_in->head) {
size_t bin = 0, desired;
Expand Down
16 changes: 10 additions & 6 deletions ext/curl/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1717,9 +1717,9 @@ static void curl_free_post(void **post)

/* {{{ curl_free_slist
*/
static void curl_free_slist(void **slist)
static void curl_free_slist(void *slist)
{
curl_slist_free_all((struct curl_slist *) *slist);
curl_slist_free_all(*((struct curl_slist **) slist));
}
/* }}} */

Expand Down Expand Up @@ -1790,9 +1790,11 @@ static void alloc_curl_handle(php_curl **ch)
(*ch)->handlers->read->stream = NULL;

zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0);
zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0);
zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0);
(*ch)->safe_upload = 1; /* for now, for BC reason we allow unsafe API */

(*ch)->to_free->slist = emalloc(sizeof(HashTable));
zend_hash_init((*ch)->to_free->slist, 4, NULL, curl_free_slist, 0);
}
/* }}} */

Expand Down Expand Up @@ -2043,6 +2045,7 @@ PHP_FUNCTION(curl_copy_handle)
}
#endif

efree(dupch->to_free->slist);
efree(dupch->to_free);
dupch->to_free = ch->to_free;

Expand Down Expand Up @@ -2438,7 +2441,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu

ph = HASH_OF(*zvalue);
if (!ph) {
char *name;
char *name = NULL;
switch (option) {
case CURLOPT_HTTPHEADER:
name = "CURLOPT_HTTPHEADER";
Expand Down Expand Up @@ -2488,7 +2491,7 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
return 1;
}
}
zend_llist_add_element(&ch->to_free->slist, &slist);
zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL);

error = curl_easy_setopt(ch->cp, option, slist);

Expand Down Expand Up @@ -3266,8 +3269,9 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC)
/* cURL destructors should be invoked only by last curl handle */
if (Z_REFCOUNT_P(ch->clone) <= 1) {
zend_llist_clean(&ch->to_free->str);
zend_llist_clean(&ch->to_free->slist);
zend_llist_clean(&ch->to_free->post);
zend_hash_destroy(ch->to_free->slist);
efree(ch->to_free->slist);
efree(ch->to_free);
FREE_ZVAL(ch->clone);
} else {
Expand Down
2 changes: 1 addition & 1 deletion ext/curl/php_curl.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ struct _php_curl_send_headers {
struct _php_curl_free {
zend_llist str;
zend_llist post;
zend_llist slist;
HashTable *slist;
};

typedef struct {
Expand Down
25 changes: 25 additions & 0 deletions ext/curl/tests/bug65458.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--TEST--
Bug #65458 (curl memory leak)
--SKIPIF--
<?php
if (!extension_loaded('curl')) exit("skip curl extension not loaded");
?>
--FILE--
<?php
$ch = curl_init();
$init = memory_get_usage();
for ($i = 0; $i < 10000; $i++) {
curl_setopt($ch, CURLOPT_HTTPHEADER, [ "SOAPAction: getItems" ]);
}

$preclose = memory_get_usage();
curl_close($ch);

// This is a slightly tricky heuristic, but basically, we want to ensure
// $preclose - $init has a delta in the order of bytes, not megabytes. Given
// the number of iterations in the loop, if we're wasting memory here, we
// should have megs and megs of extra allocations.
var_dump(($preclose - $init) < 10000);
?>
--EXPECT--
bool(true)
4 changes: 4 additions & 0 deletions ext/dom/php_dom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,11 @@ void dom_xpath_objects_free_storage(void *object TSRMLS_DC)
void dom_objects_free_storage(void *object TSRMLS_DC)
{
dom_object *intern = (dom_object *)object;
#if defined(__GNUC__) && __GNUC__ >= 3
int retcount __attribute__((unused)); /* keep compiler quiet */
#else
int retcount;
#endif

zend_object_std_dtor(&intern->std TSRMLS_CC);

Expand Down
5 changes: 0 additions & 5 deletions ext/ftp/ftp.c
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,6 @@ int
ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type, long resumepos TSRMLS_DC)
{
databuf_t *data = NULL;
int lastch;
size_t rcvd;
char arg[11];

Expand Down Expand Up @@ -828,7 +827,6 @@ ftp_get(ftpbuf_t *ftp, php_stream *outstream, const char *path, ftptype_t type,
goto bail;
}

lastch = 0;
while ((rcvd = my_recv(ftp, data->fd, data->buf, FTP_BUFSIZE))) {
if (rcvd == -1) {
goto bail;
Expand Down Expand Up @@ -1187,12 +1185,9 @@ ftp_readline(ftpbuf_t *ftp)
int
ftp_getresp(ftpbuf_t *ftp)
{
char *buf;

if (ftp == NULL) {
return 0;
}
buf = ftp->inbuf;
ftp->resp = 0;

while (1) {
Expand Down
2 changes: 1 addition & 1 deletion ext/intl/breakiterator/breakiterator_iterators.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ U_CFUNC zend_object_iterator *_breakiterator_get_iterator(
zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
U_CFUNC void breakiterator_register_IntlPartsIterator_class(TSRMLS_D);

#endif
#endif
2 changes: 1 addition & 1 deletion ext/intl/breakiterator/breakiterator_methods.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ PHP_FUNCTION(breakiter_get_error_code);

PHP_FUNCTION(breakiter_get_error_message);

#endif
#endif
2 changes: 1 addition & 1 deletion ext/intl/breakiterator/codepointiterator_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ namespace PHP {
};
}

#endif
#endif
2 changes: 1 addition & 1 deletion ext/intl/breakiterator/codepointiterator_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ U_CFUNC PHP_FUNCTION(cpbi_get_last_code_point)
BREAKITER_METHOD_FETCH_OBJECT;

RETURN_LONG(fetch_cpbi(bio)->getLastCodePoint());
}
}
2 changes: 1 addition & 1 deletion ext/intl/breakiterator/codepointiterator_methods.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

PHP_FUNCTION(cpbi_get_last_code_point);

#endif
#endif
2 changes: 1 addition & 1 deletion ext/intl/breakiterator/rulebasedbreakiterator_methods.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ PHP_FUNCTION(rbbi_get_rule_status_vec);

PHP_FUNCTION(rbbi_get_binary_rules);

#endif
#endif
Loading