]> granicus.if.org Git - php/commitdiff
- Please don't use strcmp() and friends in Zend but only the mem*
authorAndi Gutmans <andi@php.net>
Sat, 2 Feb 2002 19:35:18 +0000 (19:35 +0000)
committerAndi Gutmans <andi@php.net>
Sat, 2 Feb 2002 19:35:18 +0000 (19:35 +0000)
- functions. I didn't check this patch so please check that it works.

Zend/zend_builtin_functions.c

index a2488f147f1a26eaaa759b846cc396e23e0eba2c..b3c56d751c6e3fa5a55c21b9a318dec486d0485f 100644 (file)
@@ -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;
                }