Compare commits

...
20 Commits
Author SHA1 Message Date
Stanislav Malyshev 86aa35b787 5.4.43 2015-07-07 15:08:15 -07:00
Stanislav Malyshev e4fc1d5d1d Merge branch 'PHP-5.4' into PHP-5.4.43
* PHP-5.4:
  Better fix for bug #69958
  update news
  Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM)
  Fix bug #69923 - Buffer overflow and stack smashing error in phar_fix_filepath
  Fix bug #69958 - Segfault in Phar::convertToData on invalid file
  add missing second argument for ucfirst to the proto

Conflicts:
	ext/mysqlnd/mysqlnd.c
	ext/phar/phar_object.c
	ext/phar/tests/bug69958.phpt
2015-07-07 15:05:35 -07:00
Stanislav Malyshev 885edfef0a Better fix for bug #69958 2015-07-07 09:38:31 -07:00
Stanislav Malyshev c8157619ef update news 2015-07-07 09:38:31 -07:00
Stanislav Malyshev 97aa752fee Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM) 2015-07-07 09:38:31 -07:00
Stanislav Malyshev 6dedeb40db Fix bug #69923 - Buffer overflow and stack smashing error in phar_fix_filepath 2015-07-07 09:38:31 -07:00
Stanislav Malyshev bf58162ddf Fix bug #69958 - Segfault in Phar::convertToData on invalid file 2015-07-07 09:38:30 -07:00
Ferenc Kovacs 29533ae528 add missing second argument for ucfirst to the proto 2015-07-07 15:48:55 +02:00
Stanislav Malyshev a46bae2df2 Fix bug #69669 (mysqlnd is vulnerable to BACKRONYM) 2015-07-05 00:00:53 -07:00
Stanislav Malyshev 3e88d610e5 Fix bug #69923 - Buffer overflow and stack smashing error in phar_fix_filepath 2015-07-04 23:47:48 -07:00
Stanislav Malyshev 452d30cf7d Fix bug #69958 - Segfault in Phar::convertToData on invalid file 2015-07-04 21:01:50 -07:00
Stanislav Malyshev cd9c39d77c Merge branch 'pull-request/1350' into PHP-5.4
* pull-request/1350:
  Move strlen() check to php_mail_detect_multiple_crlf()
  Fixed Bug #69874 : Can't set empty additional_headers for mail()
2015-06-28 20:18:56 -07:00
Christoph M. Becker 921544cad9 updated NEWS 2015-06-24 00:20:32 +02:00
Christoph M. Becker a621781fdb Fixed bug #69768 (escapeshell*() doesn't cater to !)
When delayed variable substitution is enabled (can be set in the
Registry, for instance), !ENV! works similar to %ENV%, and so ! should
be escaped like %.
2015-06-24 00:15:55 +02:00
George Wang fdb580a5ad bump API version to 6.8 2015-06-22 23:38:38 -04:00
Yasuo Ohgaki d263ecd864 Move strlen() check to php_mail_detect_multiple_crlf() 2015-06-19 15:17:56 +09:00
Yasuo Ohgaki dacea3f6fb Fixed Bug #69874 : Can't set empty additional_headers for mail() 2015-06-19 12:19:12 +09:00
Lior Kaplan cc7194dd10 Fixed bug #69689 (Align PCRE_MINOR with current version) 2015-06-18 17:30:21 +03:00
Lior Kaplan 5f67caad54 Add CVE to bugs #69545, #69646 and #69667 2015-06-18 15:45:10 +03:00
Stanislav Malyshev 7f4e1a0eef 5.4.43 next 2015-06-11 20:46:47 -07:00
17 changed files with 236 additions and 87 deletions

No files matched your search

+18 -4
View File
@@ -1,14 +1,28 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2015 PHP 5.4.43
09 Jul 2015 PHP 5.4.43
- Core:
. Fixed bug #69768 (escapeshell*() doesn't cater to !). (cmb)
. Fixed bug #69874 (Can't set empty additional_headers for mail()), regression
from fix to bug #68776. (Yasuo)
- Mysqlnd:
. Fixed bug #69669 (mysqlnd is vulnerable to BACKRONYM) (CVE-2015-3152).
(Andrey)
- Phar:
. Fixed bug #69958 (Segfault in Phar::convertToData on invalid file). (Stas)
. Fixed bug #69923 (Buffer overflow and stack smashing error in
phar_fix_filepath). (Stas)
11 Jun 2015 PHP 5.4.42
- Core:
. Imroved fix for bug #69545 (Integer overflow in ftp_genlist() resulting in
heap overflow). (Max Spelsberg)
heap overflow). (CVE-2015-4643) (Max Spelsberg)
. Fixed bug #69646 (OS command injection vulnerability in escapeshellarg).
(Anatol Belski)
(CVE-2015-4642) (Anatol Belski)
. Fixed bug #69719 (Incorrect handling of paths with NULs). (Stas)
- Litespeed SAPI:
@@ -19,7 +33,7 @@ PHP NEWS
additional headers). (Yasuo)
- Postgres:
. Fixed bug #69667 (segfault in php_pgsql_meta_data). (Remi)
. Fixed bug #69667 (segfault in php_pgsql_meta_data). (CVE-2015-4644) (Remi)
- Sqlite3:
. Upgrade bundled sqlite to 3.8.10.2. (CVE-2015-3414, CVE-2015-3415,
+2 -2
View File
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=4
PHP_RELEASE_VERSION=42
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=43
PHP_EXTRA_VERSION=""
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`
+40 -25
View File
@@ -378,7 +378,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_server_option)(MYSQLND_CONN_DATA * const c
int2store(buffer, (unsigned int) option);
ret = conn->m->simple_command(conn, COM_SET_OPTION, buffer, sizeof(buffer), PROT_EOF_PACKET, FALSE, TRUE TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
}
DBG_RETURN(ret);
@@ -446,26 +446,41 @@ mysqlnd_switch_to_ssl_if_needed(
}
#ifdef MYSQLND_SSL_SUPPORTED
if ((greet_packet->server_capabilities & CLIENT_SSL) && (mysql_flags & CLIENT_SSL)) {
zend_bool verify = mysql_flags & CLIENT_SSL_VERIFY_SERVER_CERT? TRUE:FALSE;
DBG_INF("Switching to SSL");
if (!PACKET_WRITE(auth_packet, conn)) {
CONN_SET_STATE(conn, CONN_QUIT_SENT);
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
goto end;
}
if (mysql_flags & CLIENT_SSL) {
zend_bool server_has_ssl = (greet_packet->server_capabilities & CLIENT_SSL)? TRUE:FALSE;
if (server_has_ssl == FALSE) {
goto close_conn;
} else {
zend_bool verify = mysql_flags & CLIENT_SSL_VERIFY_SERVER_CERT? TRUE:FALSE;
DBG_INF("Switching to SSL");
if (!PACKET_WRITE(auth_packet, conn)) {
goto close_conn;
}
conn->net->m.set_client_option(conn->net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *) &verify TSRMLS_CC);
conn->net->m.set_client_option(conn->net, MYSQL_OPT_SSL_VERIFY_SERVER_CERT, (const char *) &verify TSRMLS_CC);
if (FAIL == conn->net->m.enable_ssl(conn->net TSRMLS_CC)) {
goto end;
if (FAIL == conn->net->m.enable_ssl(conn->net TSRMLS_CC)) {
goto end;
}
}
}
#else
auth_packet->client_flags &= ~CLIENT_SSL;
if (!PACKET_WRITE(auth_packet, conn)) {
goto close_conn;
}
#endif
ret = PASS;
end:
PACKET_FREE(auth_packet);
DBG_RETURN(ret);
close_conn:
CONN_SET_STATE(conn, CONN_QUIT_SENT);
conn->m->send_close(conn TSRMLS_CC);
SET_CLIENT_ERROR(*conn->error_info, CR_SERVER_GONE_ERROR, UNKNOWN_SQLSTATE, mysqlnd_server_gone);
PACKET_FREE(auth_packet);
DBG_RETURN(ret);
}
/* }}} */
@@ -587,7 +602,7 @@ mysqlnd_connect_run_authentication(
if (plugin_data) {
mnd_efree(plugin_data);
}
if (ret == PASS) {
DBG_INF_FMT("saving requested_protocol=%s", requested_protocol);
conn->m->set_client_option(conn, MYSQLND_OPT_AUTH_PROTOCOL, requested_protocol TSRMLS_CC);
@@ -1438,7 +1453,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, sqlstate)(const MYSQLND_CONN_DATA * const conn
/* {{{ mysqlnd_old_escape_string */
PHPAPI ulong
PHPAPI ulong
mysqlnd_old_escape_string(char * newstr, const char * escapestr, size_t escapestr_len TSRMLS_DC)
{
DBG_ENTER("mysqlnd_old_escape_string");
@@ -1599,7 +1614,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, char **me
if (PASS == (ret = PACKET_READ(stats_header, conn))) {
/* will be freed by Zend, thus don't use the mnd_ allocator */
*message = estrndup(stats_header->message, stats_header->message_len);
*message = estrndup(stats_header->message, stats_header->message_len);
*message_len = stats_header->message_len;
DBG_INF(*message);
}
@@ -1724,7 +1739,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
}
DBG_RETURN(ret);
DBG_RETURN(ret);
}
/* }}} */
@@ -2243,7 +2258,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn,
*/
end:
if (TRUE == local_tx_started) {
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
}
DBG_INF(ret == PASS? "PASS":"FAIL");
DBG_RETURN(ret);
@@ -2335,7 +2350,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
ret = FAIL;
break;
}
new_charset_name = mnd_pestrdup(value, conn->persistent);
if (!new_charset_name) {
goto oom;
@@ -2401,11 +2416,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c
default:
ret = FAIL;
}
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
DBG_RETURN(ret);
oom:
SET_OOM_ERROR(*conn->error_info);
conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, FAIL TSRMLS_CC);
end:
DBG_RETURN(FAIL);
}
@@ -2446,7 +2461,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn TSR
conn->current_result = NULL;
} while (0);
conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
}
DBG_RETURN(result);
@@ -2486,7 +2501,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn T
conn->current_result = NULL;
} while (0);
conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, result == NULL? FAIL:PASS TSRMLS_CC);
}
DBG_RETURN(result);
}
@@ -2515,7 +2530,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsi
if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
ret = conn->m->query(conn, (mode) ? "SET AUTOCOMMIT=1":"SET AUTOCOMMIT=0", sizeof("SET AUTOCOMMIT=1") - 1 TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
}
DBG_RETURN(ret);
@@ -2533,7 +2548,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit)(MYSQLND_CONN_DATA * conn TSRMLS_DC)
if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
ret = conn->m->query(conn, "COMMIT", sizeof("COMMIT") - 1 TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
}
DBG_RETURN(ret);
@@ -2551,7 +2566,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_rollback)(MYSQLND_CONN_DATA * conn TSRMLS_D
if (PASS == conn->m->local_tx_start(conn, this_func TSRMLS_CC)) {
ret = conn->m->query(conn, "ROLLBACK", sizeof("ROLLBACK") - 1 TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
conn->m->local_tx_end(conn, this_func, ret TSRMLS_CC);
}
DBG_RETURN(ret);
+2 -2
View File
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */
#define PCRE_MAJOR 8
#define PCRE_MINOR 36
#define PCRE_MINOR 37
#define PCRE_PRERELEASE
#define PCRE_DATE 2014-09-26
#define PCRE_DATE 2015-04-28
/* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE, the appropriate
+8 -2
View File
@@ -2142,7 +2142,7 @@ char *tsrm_strtok_r(char *s, const char *delim, char **last) /* {{{ */
*/
char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC) /* {{{ */
{
char newpath[MAXPATHLEN];
char *newpath;
int newpath_len;
char *ptr;
char *tok;
@@ -2150,8 +2150,10 @@ char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC) /* {{{
if (PHAR_G(cwd_len) && use_cwd && path_length > 2 && path[0] == '.' && path[1] == '/') {
newpath_len = PHAR_G(cwd_len);
newpath = emalloc(strlen(path) + newpath_len + 1);
memcpy(newpath, PHAR_G(cwd), newpath_len);
} else {
newpath = emalloc(strlen(path) + 2);
newpath[0] = '/';
newpath_len = 1;
}
@@ -2174,6 +2176,7 @@ char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC) /* {{{
if (*tok == '.') {
efree(path);
*new_len = 1;
efree(newpath);
return estrndup("/", 1);
}
break;
@@ -2181,9 +2184,11 @@ char *phar_fix_filepath(char *path, int *new_len, int use_cwd TSRMLS_DC) /* {{{
if (tok[0] == '.' && tok[1] == '.') {
efree(path);
*new_len = 1;
efree(newpath);
return estrndup("/", 1);
}
}
efree(newpath);
return path;
}
@@ -2232,7 +2237,8 @@ last_time:
efree(path);
*new_len = newpath_len;
return estrndup(newpath, newpath_len);
newpath[newpath_len] = '\0';
return erealloc(newpath, newpath_len + 1);
}
/* }}} */
+47 -41
View File
@@ -1269,7 +1269,7 @@ PHP_METHOD(Phar, __construct)
INIT_PZVAL(&arg2);
ZVAL_LONG(&arg2, flags);
zend_call_method_with_2_params(&zobj, Z_OBJCE_P(zobj),
zend_call_method_with_2_params(&zobj, Z_OBJCE_P(zobj),
&spl_ce_RecursiveDirectoryIterator->constructor, "__construct", NULL, &arg1, &arg2);
if (!phar_data->is_persistent) {
@@ -1293,7 +1293,7 @@ PHP_METHOD(Phar, getSupportedSignatures)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
array_init(return_value);
add_next_index_stringl(return_value, "MD5", 3, 1);
@@ -1320,7 +1320,7 @@ PHP_METHOD(Phar, getSupportedCompression)
if (zend_parse_parameters_none() == FAILURE) {
return;
}
array_init(return_value);
phar_request_initialize(TSRMLS_C);
@@ -1608,7 +1608,7 @@ phar_spl_fileinfo:
}
return ZEND_HASH_APPLY_STOP;
}
base = temp;
base_len = strlen(base);
@@ -1805,7 +1805,7 @@ after_open_fp:
/* {{{ proto array Phar::buildFromDirectory(string base_dir[, string regex])
* Construct a phar archive from an existing directory, recursively.
* Optional second parameter is a regular expression for filtering directory contents.
*
*
* Return value is an array mapping phar index to actual files added.
*/
PHP_METHOD(Phar, buildFromDirectory)
@@ -1845,7 +1845,7 @@ PHP_METHOD(Phar, buildFromDirectory)
ZVAL_LONG(&arg2, SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS);
#endif
zend_call_method_with_2_params(&iter, spl_ce_RecursiveDirectoryIterator,
zend_call_method_with_2_params(&iter, spl_ce_RecursiveDirectoryIterator,
&spl_ce_RecursiveDirectoryIterator->constructor, "__construct", NULL, &arg, &arg2);
if (EG(exception)) {
@@ -1862,7 +1862,7 @@ PHP_METHOD(Phar, buildFromDirectory)
RETURN_FALSE;
}
zend_call_method_with_1_params(&iteriter, spl_ce_RecursiveIteratorIterator,
zend_call_method_with_1_params(&iteriter, spl_ce_RecursiveIteratorIterator,
&spl_ce_RecursiveIteratorIterator->constructor, "__construct", NULL, iter);
if (EG(exception)) {
@@ -1887,7 +1887,7 @@ PHP_METHOD(Phar, buildFromDirectory)
INIT_PZVAL(&arg2);
ZVAL_STRINGL(&arg2, regex, regex_len, 0);
zend_call_method_with_2_params(&regexiter, spl_ce_RegexIterator,
zend_call_method_with_2_params(&regexiter, spl_ce_RegexIterator,
&spl_ce_RegexIterator->constructor, "__construct", NULL, iteriter, &arg2);
}
@@ -2008,7 +2008,7 @@ PHP_METHOD(Phar, buildFromIterator)
PHP_METHOD(Phar, count)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -2089,9 +2089,10 @@ static int phar_copy_file_contents(phar_entry_info *entry, php_stream *fp TSRMLS
}
/* }}} */
static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool compress TSRMLS_DC) /* {{{ */
static zval *phar_rename_archive(phar_archive_data **sphar, char *ext, zend_bool compress TSRMLS_DC) /* {{{ */
{
const char *oldname = NULL;
phar_archive_data *phar = *sphar;
char *oldpath = NULL;
char *basename = NULL, *basepath = NULL;
char *newname = NULL, *newpath = NULL;
@@ -2173,7 +2174,7 @@ static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool c
spprintf(&newname, 0, "%s.%s", strtok(basename, "."), ext);
efree(basename);
basepath = estrndup(oldpath, (strlen(oldpath) - oldname_len));
phar->fname_len = spprintf(&newpath, 0, "%s%s", basepath, newname);
@@ -2199,6 +2200,7 @@ static zval *phar_rename_archive(phar_archive_data *phar, char *ext, zend_bool c
phar->fp = NULL;
phar_destroy_phar_data(phar TSRMLS_CC);
phar = *pphar;
*sphar = NULL;
phar->refcount++;
newpath = oldpath;
goto its_ok;
@@ -2413,15 +2415,19 @@ no_copy:
phar_add_virtual_dirs(phar, newentry.filename, newentry.filename_len TSRMLS_CC);
}
if ((ret = phar_rename_archive(phar, ext, 0 TSRMLS_CC))) {
if ((ret = phar_rename_archive(&phar, ext, 0 TSRMLS_CC))) {
return ret;
} else {
zend_hash_destroy(&(phar->manifest));
zend_hash_destroy(&(phar->mounted_dirs));
zend_hash_destroy(&(phar->virtual_dirs));
php_stream_close(phar->fp);
efree(phar->fname);
efree(phar);
if(phar != NULL) {
zend_hash_destroy(&(phar->manifest));
zend_hash_destroy(&(phar->mounted_dirs));
zend_hash_destroy(&(phar->virtual_dirs));
if (phar->fp) {
php_stream_close(phar->fp);
}
efree(phar->fname);
efree(phar);
}
return NULL;
}
}
@@ -2639,7 +2645,7 @@ PHP_METHOD(Phar, convertToData)
PHP_METHOD(Phar, isCompressed)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -2663,7 +2669,7 @@ PHP_METHOD(Phar, isWritable)
{
php_stream_statbuf ssb;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -2741,7 +2747,7 @@ PHP_METHOD(Phar, delete)
PHP_METHOD(Phar, getAlias)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -2758,7 +2764,7 @@ PHP_METHOD(Phar, getAlias)
PHP_METHOD(Phar, getPath)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -2874,7 +2880,7 @@ valid_alias:
PHP_METHOD(Phar, getVersion)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -2889,7 +2895,7 @@ PHP_METHOD(Phar, getVersion)
PHP_METHOD(Phar, startBuffering)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -2904,7 +2910,7 @@ PHP_METHOD(Phar, startBuffering)
PHP_METHOD(Phar, isBuffering)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -2921,7 +2927,7 @@ PHP_METHOD(Phar, stopBuffering)
char *error;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -3156,7 +3162,7 @@ PHP_METHOD(Phar, setSignatureAlgorithm)
PHP_METHOD(Phar, getSignature)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -3200,7 +3206,7 @@ PHP_METHOD(Phar, getSignature)
PHP_METHOD(Phar, getModified)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -3462,7 +3468,7 @@ PHP_METHOD(Phar, decompressFiles)
{
char *error;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -3983,7 +3989,7 @@ PHP_METHOD(Phar, getStub)
phar_entry_info *stub;
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -4086,7 +4092,7 @@ PHP_METHOD(Phar, hasMetadata)
PHP_METHOD(Phar, getMetadata)
{
PHAR_ARCHIVE_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -4544,7 +4550,7 @@ PHP_METHOD(PharFileInfo, __construct)
INIT_PZVAL(&arg1);
ZVAL_STRINGL(&arg1, fname, fname_len, 0);
zend_call_method_with_1_params(&zobj, Z_OBJCE_P(zobj),
zend_call_method_with_1_params(&zobj, Z_OBJCE_P(zobj),
&spl_ce_SplFileInfo->constructor, "__construct", NULL, &arg1);
}
/* }}} */
@@ -4582,7 +4588,7 @@ PHP_METHOD(PharFileInfo, __destruct)
PHP_METHOD(PharFileInfo, getCompressedSize)
{
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -4624,7 +4630,7 @@ PHP_METHOD(PharFileInfo, isCompressed)
PHP_METHOD(PharFileInfo, getCRC32)
{
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -4650,7 +4656,7 @@ PHP_METHOD(PharFileInfo, getCRC32)
PHP_METHOD(PharFileInfo, isCRCChecked)
{
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -4665,7 +4671,7 @@ PHP_METHOD(PharFileInfo, isCRCChecked)
PHP_METHOD(PharFileInfo, getPharFlags)
{
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -4743,7 +4749,7 @@ PHP_METHOD(PharFileInfo, chmod)
PHP_METHOD(PharFileInfo, hasMetadata)
{
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -4758,7 +4764,7 @@ PHP_METHOD(PharFileInfo, hasMetadata)
PHP_METHOD(PharFileInfo, getMetadata)
{
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -4839,7 +4845,7 @@ PHP_METHOD(PharFileInfo, delMetadata)
char *error;
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -4897,7 +4903,7 @@ PHP_METHOD(PharFileInfo, getContent)
phar_entry_info *link;
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
@@ -5071,7 +5077,7 @@ PHP_METHOD(PharFileInfo, decompress)
{
char *error;
PHAR_ENTRY_OBJECT();
if (zend_parse_parameters_none() == FAILURE) {
return;
}
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Phar: bug #69958: Segfault in Phar::convertToData on invalid file
--XFAIL--
Still has memory leaks, see https://bugs.php.net/bug.php?id=70005
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--FILE--
<?php
$tarphar = new PharData(__DIR__.'/bug69958.tar');
$phar = $tarphar->convertToData(Phar::TAR);
--EXPECTF--
Fatal error: Uncaught exception 'BadMethodCallException' with message 'phar "%s/bug69958.tar" exists and must be unlinked prior to conversion' in %s/bug69958.php:%d
Stack trace:
#0 %s/bug69958.php(%d): PharData->convertToData(%d)
#1 {main}
thrown in %s/bug69958.php on line %d
Binary file not shown.
+3 -1
View File
@@ -281,9 +281,10 @@ PHPAPI char *php_escape_shell_cmd(char *str)
break;
#else
/* % is Windows specific for enviromental variables, ^%PATH% will
output PATH whil ^%PATH^% not. escapeshellcmd will escape all %.
output PATH while ^%PATH^% will not. escapeshellcmd will escape all % and !.
*/
case '%':
case '!':
case '"':
case '\'':
#endif
@@ -366,6 +367,7 @@ PHPAPI char *php_escape_shell_arg(char *str)
#ifdef PHP_WIN32
case '"':
case '%':
case '!':
cmd[y++] = ' ';
break;
#else
+3 -3
View File
@@ -225,7 +225,7 @@ static int php_mail_detect_multiple_crlf(char *hdr) {
/* This function detects multiple/malformed multiple newlines. */
size_t len;
if (!hdr) {
if (!hdr || !strlen(hdr)) {
return 0;
}
@@ -312,7 +312,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
php_basename(tmp, strlen(tmp), NULL, 0,&f, &f_len TSRMLS_CC);
if (headers != NULL) {
if (headers != NULL && *headers) {
spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n%s", php_getuid(TSRMLS_C), f, headers);
} else {
spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s", php_getuid(TSRMLS_C), f);
@@ -420,7 +420,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path);
#if PHP_SIGCHILD
if (sig_handler) {
signal(SIGCHLD, sig_handler);
signal(SIGCHLD, sig_handler);
}
#endif
MAIL_RET(0);
+1 -1
View File
@@ -2738,7 +2738,7 @@ PHP_FUNCTION(lcfirst)
}
/* }}} */
/* {{{ proto string ucwords(string str)
/* {{{ proto string ucwords(string str [, string delims])
Uppercase the first character of every word in a string */
PHP_FUNCTION(ucwords)
{
@@ -18,6 +18,7 @@ echo "Simple testcase for escapeshellarg() function\n";
var_dump(escapeshellarg("Mr O'Neil"));
var_dump(escapeshellarg("Mr O\'Neil"));
var_dump(escapeshellarg("%FILENAME"));
var_dump(escapeshellarg("!FILENAME"));
var_dump(escapeshellarg(""));
echo "Done\n";
@@ -27,5 +28,6 @@ Simple testcase for escapeshellarg() function
string(11) ""Mr O'Neil""
string(12) ""Mr O\'Neil""
string(11) "" FILENAME""
string(11) "" FILENAME""
string(2) """"
Done
@@ -17,7 +17,8 @@ $data = array(
'%^',
'#&;`|*?',
'~<>\\',
'%NOENV%'
'%NOENV%',
'!NOENV!'
);
$count = 1;
@@ -46,4 +47,6 @@ string(14) "^#^&^;^`^|^*^?"
string(8) "^~^<^>^\"
-- Test 8 --
string(9) "^%NOENV^%"
-- Test 9 --
string(9) "^!NOENV^!"
Done
+42
View File
@@ -0,0 +1,42 @@
--TEST--
Bug #69874: Null addtional_headers does not send mail
--INI--
sendmail_path=tee mailBasic.out >/dev/null
mail.add_x_header = Off
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == "WIN")
die("skip Won't run on Windows");
?>
--FILE--
<?php
/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
* Description: Send an email message
* Source code: ext/standard/mail.c
* Alias to functions:
*/
echo "*** Testing mail() : send email without additional headers ***\n";
// Initialise all required variables
$to = 'user@company.com';
$subject = 'Test Subject';
$message = 'A Message';
$outFile = "mailBasic.out";
@unlink($outFile);
var_dump( mail($to, $subject, $message) );
echo file_get_contents($outFile);
unlink($outFile);
?>
===DONE===
--EXPECTF--
*** Testing mail() : send email without additional headers ***
bool(true)
To: user@company.com
Subject: Test Subject
A Message
===DONE===
+43
View File
@@ -0,0 +1,43 @@
--TEST--
Bug #69874: Null addtional_headers does not send mail
--INI--
sendmail_path=tee mailBasic.out >/dev/null
mail.add_x_header = On
--SKIPIF--
<?php
if(substr(PHP_OS, 0, 3) == "WIN")
die("skip Won't run on Windows");
?>
--FILE--
<?php
/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
* Description: Send an email message
* Source code: ext/standard/mail.c
* Alias to functions:
*/
echo "*** Testing mail() : send email without additional headers ***\n";
// Initialise all required variables
$to = 'user@company.com';
$subject = 'Test Subject';
$message = 'A Message';
$outFile = "mailBasic.out";
@unlink($outFile);
var_dump( mail($to, $subject, $message, '') );
echo file_get_contents($outFile);
unlink($outFile);
?>
===DONE===
--EXPECTF--
*** Testing mail() : send email without additional headers ***
bool(true)
To: user@company.com
Subject: Test Subject
X-PHP-Originating-Script: %d:bug69874_2.php
A Message
===DONE===
+4 -4
View File
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 5
#define PHP_MINOR_VERSION 4
#define PHP_RELEASE_VERSION 42
#define PHP_EXTRA_VERSION "-dev"
#define PHP_VERSION "5.4.42-dev"
#define PHP_VERSION_ID 50442
#define PHP_RELEASE_VERSION 43
#define PHP_EXTRA_VERSION ""
#define PHP_VERSION "5.4.43"
#define PHP_VERSION_ID 50443
+1 -1
View File
@@ -427,7 +427,7 @@ static void sapi_lsapi_log_message(char *message TSRMLS_DC)
static sapi_module_struct lsapi_sapi_module =
{
"litespeed",
"LiteSpeed V6.7",
"LiteSpeed V6.8",
php_lsapi_startup, /* startup */
php_module_shutdown_wrapper, /* shutdown */