]> granicus.if.org Git - php/commitdiff
Fixed string comparison (it may fail in case of not null-terminated strings)
authorDmitry Stogov <dmitry@zend.com>
Wed, 31 Jan 2018 09:38:02 +0000 (12:38 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 31 Jan 2018 09:38:02 +0000 (12:38 +0300)
Zend/zend_string.c

index 873fb6e496ddc5d74729741354b83c02cae25802..23d6d245febc36b6384e62e54fb315c71941528b 100644 (file)
@@ -346,7 +346,7 @@ ZEND_API zend_bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_str
                "jmp .LL3%=\n\t"
                ".LL2%=:\n\t"
                "negl %1\n\t"
-               "lea 0x1c(,%1,8), %1\n\t"
+               "lea 0x20(,%1,8), %1\n\t"
                "shll %b1, %0\n\t"
                "sete %b0\n\t"
                "movzbl %b0, %0\n\t"
@@ -414,7 +414,7 @@ ZEND_API zend_bool ZEND_FASTCALL zend_string_equal_val(zend_string *s1, zend_str
                "jmp .LL3%=\n\t"
                ".LL2%=:\n\t"
                "negq %1\n\t"
-               "lea 0x3c(,%1,8), %1\n\t"
+               "lea 0x40(,%1,8), %1\n\t"
                "shlq %b1, %0\n\t"
                "sete %b0\n\t"
                "movzbq %b0, %0\n\t"