Skip to content

Commit 20a34b7

Browse files
Merge branch 'php:master' into master
2 parents fa8ace8 + 6f785b0 commit 20a34b7

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ PHP NEWS
1818
. Added shadow stack support for fibers. (Chen Hu)
1919
. Fix bug GH-9965 (Fix accidental caching of default arguments with side
2020
effects). (ilutov)
21+
. Implement GH-10217 (Use strlen() for determining the class_name length).
22+
(Dennis Buteyn)
2123

2224
- Fileinfo:
2325
. Upgrade bundled libmagic to 5.43. (Anatol)

Zend/zend_API.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ typedef struct _zend_fcall_info_cache {
267267
#endif
268268

269269
#define INIT_CLASS_ENTRY(class_container, class_name, functions) \
270-
INIT_CLASS_ENTRY_EX(class_container, class_name, sizeof(class_name)-1, functions)
270+
INIT_CLASS_ENTRY_EX(class_container, class_name, strlen(class_name), functions)
271271

272272
#define INIT_CLASS_ENTRY_EX(class_container, class_name, class_name_len, functions) \
273273
{ \

ext/ffi/ffi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ static zval *zend_ffi_cdata_get(zend_object *obj, zend_string *member, int read_
11071107

11081108
if (UNEXPECTED(!zend_string_equals_literal(member, "cdata"))) {
11091109
zend_throw_error(zend_ffi_exception_ce, "Only 'cdata' property may be read");
1110-
return &EG(uninitialized_zval);;
1110+
return &EG(uninitialized_zval);
11111111
}
11121112

11131113
zend_ffi_cdata_to_zval(cdata, cdata->ptr, type, BP_VAR_R, rv, 0, 0, 0);
@@ -1123,13 +1123,13 @@ static zval *zend_ffi_cdata_set(zend_object *obj, zend_string *member, zval *val
11231123
#if 0
11241124
if (UNEXPECTED(!cdata->ptr)) {
11251125
zend_throw_error(zend_ffi_exception_ce, "NULL pointer dereference");
1126-
return &EG(uninitialized_zval);;
1126+
return &EG(uninitialized_zval);
11271127
}
11281128
#endif
11291129

11301130
if (UNEXPECTED(!zend_string_equals_literal(member, "cdata"))) {
11311131
zend_throw_error(zend_ffi_exception_ce, "Only 'cdata' property may be set");
1132-
return &EG(uninitialized_zval);;
1132+
return &EG(uninitialized_zval);
11331133
}
11341134

11351135
zend_ffi_zval_to_cdata(cdata->ptr, type, value);
@@ -2648,7 +2648,7 @@ static zend_result zend_ffi_pass_arg(zval *arg, zend_ffi_type *type, ffi_type **
26482648
zend_ffi_cdata *cdata = (zend_ffi_cdata*)Z_OBJ_P(arg);
26492649

26502650
if (zend_ffi_is_compatible_type(type, ZEND_FFI_TYPE(cdata->type))) {
2651-
*pass_type = zend_ffi_make_fake_struct_type(type);;
2651+
*pass_type = zend_ffi_make_fake_struct_type(type);
26522652
arg_values[n] = cdata->ptr;
26532653
break;
26542654
}
@@ -5770,7 +5770,7 @@ void zend_ffi_resolve_typedef(const char *name, size_t name_len, zend_ffi_dcl *d
57705770
if (FFI_G(symbols)) {
57715771
sym = zend_hash_str_find_ptr(FFI_G(symbols), name, name_len);
57725772
if (sym && sym->kind == ZEND_FFI_SYM_TYPE) {
5773-
dcl->type = ZEND_FFI_TYPE(sym->type);;
5773+
dcl->type = ZEND_FFI_TYPE(sym->type);
57745774
if (sym->is_const) {
57755775
dcl->attr |= ZEND_FFI_ATTR_CONST;
57765776
}

0 commit comments

Comments
 (0)