mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-26 18:35:42 +00:00
Merge remote-tracking branch 'origin/master' into str_size_and_int64
This commit is contained in:
commit
49c20cdfcb
3 files changed
+41
-11
No files matched your search
@@ -1123,7 +1123,9 @@ static void zend_accel_add_key(char *key, zend_size_t key_length, zend_accel_has
|
||||
char *new_key = zend_shared_alloc(key_length + 1);
|
||||
if (new_key) {
|
||||
memcpy(new_key, key, key_length + 1);
|
||||
zend_accel_hash_update(&ZCSG(hash), new_key, key_length + 1, 1, bucket);
|
||||
if (zend_accel_hash_update(&ZCSG(hash), new_key, key_length + 1, 1, bucket)) {
|
||||
zend_accel_error(ACCEL_LOG_INFO, "Added key '%s'", new_key);
|
||||
}
|
||||
} else {
|
||||
zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_OOM TSRMLS_CC);
|
||||
}
|
||||
@@ -1211,16 +1213,21 @@ static zend_persistent_script *cache_script_in_shared_memory(zend_persistent_scr
|
||||
|
||||
/* store script structure in the hash table */
|
||||
bucket = zend_accel_hash_update(&ZCSG(hash), new_persistent_script->full_path, new_persistent_script->full_path_len + 1, 0, new_persistent_script);
|
||||
if (bucket && !ZCG(accel_directives).revalidate_path &&
|
||||
/* key may contain non-persistent PHAR aliases (see issues #115 and #149) */
|
||||
memcmp(key, "phar://", sizeof("phar://") - 1) != 0 &&
|
||||
(new_persistent_script->full_path_len != key_length ||
|
||||
memcmp(new_persistent_script->full_path, key, key_length) != 0)) {
|
||||
/* link key to the same persistent script in hash table */
|
||||
if (!zend_accel_hash_update(&ZCSG(hash), key, key_length + 1, 1, bucket)) {
|
||||
zend_accel_error(ACCEL_LOG_DEBUG, "No more entries in hash table!");
|
||||
ZSMMG(memory_exhausted) = 1;
|
||||
zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH TSRMLS_CC);
|
||||
if (bucket) {
|
||||
zend_accel_error(ACCEL_LOG_INFO, "Cached script '%s'", new_persistent_script->full_path);
|
||||
if (!ZCG(accel_directives).revalidate_path &&
|
||||
/* key may contain non-persistent PHAR aliases (see issues #115 and #149) */
|
||||
memcmp(key, "phar://", sizeof("phar://") - 1) != 0 &&
|
||||
(new_persistent_script->full_path_len != key_length ||
|
||||
memcmp(new_persistent_script->full_path, key, key_length) != 0)) {
|
||||
/* link key to the same persistent script in hash table */
|
||||
if (zend_accel_hash_update(&ZCSG(hash), key, key_length + 1, 1, bucket)) {
|
||||
zend_accel_error(ACCEL_LOG_INFO, "Added key '%s'", key);
|
||||
} else {
|
||||
zend_accel_error(ACCEL_LOG_DEBUG, "No more entries in hash table!");
|
||||
ZSMMG(memory_exhausted) = 1;
|
||||
zend_accel_schedule_restart_if_necessary(ACCEL_RESTART_HASH TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -689,6 +689,13 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
|
||||
|
||||
static PHP_INI_MH(OnUpdateName) /* {{{ */
|
||||
{
|
||||
/* Don't accept a blank session name from php.ini or -d session.name= */
|
||||
if (!PG(modules_activated) && !new_value_length) {
|
||||
/* Force the default value. */
|
||||
new_value = "PHPSESSID";
|
||||
new_value_length = 9;
|
||||
}
|
||||
|
||||
/* Numeric session.name won't work at all */
|
||||
if (PG(modules_activated) &&
|
||||
(!new_value_length || is_numeric_string(new_value, new_value_length, NULL, NULL, 0))) {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug #66481: Calls to session_name() segfault when session.name is null.
|
||||
--INI--
|
||||
session.name=
|
||||
--SKIPIF--
|
||||
<?php include('skipif.inc'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
var_dump(session_name("foo"));
|
||||
var_dump(session_name("bar"));
|
||||
|
||||
--EXPECTF--
|
||||
string(9) "PHPSESSID"
|
||||
string(3) "foo"
|
||||
|
||||
Reference in new issue
Block a user