From: Andi Gutmans Date: Sat, 2 Feb 2002 19:35:18 +0000 (+0000) Subject: - Please don't use strcmp() and friends in Zend but only the mem* X-Git-Tag: PRE_ISSET_PATCH~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2c95fc2d553c3ece602bab89d639754cebf8c5a2;p=php - 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. --- diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index a2488f147f..b3c56d751c 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -556,7 +556,7 @@ static void is_a_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool only_subclass) else ce = Z_OBJCE_PP(obj); for (; ce != NULL; ce = ce->parent) { - if (!strncmp(ce->name, lcname, MIN(ce->name_length, (uint)Z_STRLEN_PP(class_name)))) { + if ((ce->name_length == Z_STRLEN_PP(class_name)) && !memcmp(ce->name, lcname, ce->name_length)) { efree(lcname); RETURN_TRUE; }