Skip to content

Commit 2c95fc2

Browse files
author
Andi Gutmans
committed
- Please don't use strcmp() and friends in Zend but only the mem*
- functions. I didn't check this patch so please check that it works.
1 parent 5319d84 commit 2c95fc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_builtin_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass)
556556
else
557557
ce = Z_OBJCE_PP(obj);
558558
for (; ce != NULL; ce = ce->parent) {
559-
if (!strncmp(ce->name, lcname, MIN(ce->name_length, (uint)Z_STRLEN_PP(class_name)))) {
559+
if ((ce->name_length == Z_STRLEN_PP(class_name)) && !memcmp(ce->name, lcname, ce->name_length)) {
560560
efree(lcname);
561561
RETURN_TRUE;
562562
}

0 commit comments

Comments
 (0)