Skip to content

Commit c527785

Browse files
committed
Bump
1 parent a21c3e4 commit c527785

File tree

6 files changed

+30
-32
lines changed

6 files changed

+30
-32
lines changed

Zend/zend_extensions.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "zend_extensions.h"
2121
#include "zend_system_id.h"
22-
#include "SAPI.h"
2322

2423
ZEND_API zend_llist zend_extensions;
2524
ZEND_API uint32_t zend_extension_flags = 0;

Zend/zend_portability.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,14 @@
162162
# define PHP_RTLD_MODE RTLD_LAZY
163163
# endif
164164

165+
/* True global */
166+
static bool use_deepbind = false;
167+
165168
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
166169
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
167170
# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(memory_sanitizer)
168171
# if defined(LM_ID_NEWLM)
169-
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | ((sapi_module.flags & SAPI_MODULE_FLAG_ISOLATE_SYMBOLS) != 0 ? RTLD_DEEPBIND : 0))
172+
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | (use_deepbind ? RTLD_DEEPBIND : 0))
170173
# else
171174
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND)
172175
# endif

main/SAPI.h

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ SAPI_API double sapi_get_request_time(void);
234234
SAPI_API void sapi_terminate_process(void);
235235
END_EXTERN_C()
236236

237-
#define SAPI_MODULE_FLAG_ISOLATE_SYMBOLS (1<<0)
238-
239237
struct _sapi_module_struct {
240238
char *name;
241239
char *pretty_name;
@@ -289,8 +287,6 @@ struct _sapi_module_struct {
289287
const char *ini_entries;
290288
const zend_function_entry *additional_functions;
291289
unsigned int (*input_filter_init)(void);
292-
293-
unsigned int flags;
294290
};
295291

296292
struct _sapi_post_entry {
@@ -325,25 +321,22 @@ SAPI_API SAPI_TREAT_DATA_FUNC(php_default_treat_data);
325321
SAPI_API SAPI_INPUT_FILTER_FUNC(php_default_input_filter);
326322
END_EXTERN_C()
327323

328-
#define STANDARD_SAPI_MODULE_PROPERTIES STANDARD_SAPI_MODULE_PROPERTIES_WITH_FLAGS(0)
329-
330-
#define STANDARD_SAPI_MODULE_PROPERTIES_WITH_FLAGS(_flags) \
331-
NULL, /* php_ini_path_override */ \
332-
NULL, /* default_post_reader */ \
333-
NULL, /* treat_data */ \
334-
NULL, /* executable_location */ \
335-
0, /* php_ini_ignore */ \
336-
0, /* php_ini_ignore_cwd */ \
337-
NULL, /* get_fd */ \
338-
NULL, /* force_http_10 */ \
339-
NULL, /* get_target_uid */ \
340-
NULL, /* get_target_gid */ \
341-
NULL, /* input_filter */ \
342-
NULL, /* ini_defaults */ \
343-
0, /* phpinfo_as_text; */ \
344-
NULL, /* ini_entries; */ \
345-
NULL, /* additional_functions */ \
346-
NULL, /* input_filter_init */ \
347-
(_flags) /* flags */
324+
#define STANDARD_SAPI_MODULE_PROPERTIES \
325+
NULL, /* php_ini_path_override */ \
326+
NULL, /* default_post_reader */ \
327+
NULL, /* treat_data */ \
328+
NULL, /* executable_location */ \
329+
0, /* php_ini_ignore */ \
330+
0, /* php_ini_ignore_cwd */ \
331+
NULL, /* get_fd */ \
332+
NULL, /* force_http_10 */ \
333+
NULL, /* get_target_uid */ \
334+
NULL, /* get_target_gid */ \
335+
NULL, /* input_filter */ \
336+
NULL, /* ini_defaults */ \
337+
0, /* phpinfo_as_text; */ \
338+
NULL, /* ini_entries; */ \
339+
NULL, /* additional_functions */ \
340+
NULL /* input_filter_init */
348341

349342
#endif /* SAPI_H */

sapi/litespeed/lsapilib.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9393
#endif
9494

9595
#include <Zend/zend_portability.h>
96-
#include "main/SAPI.h"
9796

9897
struct lsapi_MD5Context {
9998
uint32 buf[4];
@@ -2653,8 +2652,8 @@ int LSAPI_ParseSockAddr( const char * pBind, struct sockaddr * pAddr )
26532652
{
26542653
case '/':
26552654
pAddr->sa_family = AF_UNIX;
2656-
strncpy( ((struct sockaddr_un *)pAddr)->sun_path, p,
2657-
sizeof(((struct sockaddr_un *)pAddr)->sun_path) );
2655+
memccpy(((struct sockaddr_un *)pAddr)->sun_path, p, 0,
2656+
sizeof(((struct sockaddr_un *)pAddr)->sun_path));
26582657
return 0;
26592658

26602659
case '[':

sapi/litespeed/lscriu.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8585
#include "lscriu.h"
8686

8787
#include <Zend/zend_portability.h>
88-
#include "main/SAPI.h"
8988

9089
#define LSCRIU_PATH 256
9190

@@ -418,7 +417,9 @@ static int LSCRIU_Native_Dump(pid_t iPid,
418417
memset(&criu_native_dump, 0, sizeof(criu_native_dump));
419418
criu_native_dump.m_iPidToDump = iPid;
420419
strncpy(criu_native_dump.m_chImageDirectory, pchImagePath,
421-
sizeof(criu_native_dump.m_chImageDirectory));
420+
sizeof(criu_native_dump.m_chImageDirectory) - 1);
421+
criu_native_dump.m_chImageDirectory[
422+
sizeof(criu_native_dump.m_chImageDirectory) - 1] = '\0';
422423
pchLastSlash = strrchr(criu_native_dump.m_chSocketDir,'/');
423424
if (pchLastSlash) {
424425
pchLastSlash++;

sapi/phpdbg/phpdbg_prompt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <stdio.h>
2020
#include <string.h>
2121
#include "zend.h"
22-
#include "main/SAPI.h"
2322
#include "zend_compile.h"
2423
#include "zend_exceptions.h"
2524
#include "zend_vm.h"
@@ -703,6 +702,10 @@ static inline void phpdbg_handle_exception(void) /* {{{ */
703702
EG(exception) = NULL;
704703
msg = ZSTR_EMPTY_ALLOC();
705704
} else {
705+
if (UNEXPECTED(Z_ISREF(tmp))) {
706+
zend_unwrap_reference(&tmp);
707+
}
708+
ZEND_ASSERT(Z_TYPE(tmp) == IS_STRING);
706709
zend_update_property_string(zend_get_exception_base(ex), ex, ZEND_STRL("string"), Z_STRVAL(tmp));
707710
zval_ptr_dtor(&tmp);
708711
msg = zval_get_string(zend_read_property_ex(zend_get_exception_base(ex), ex, ZSTR_KNOWN(ZEND_STR_STRING), /* silent */ true, &rv));

0 commit comments

Comments
 (0)