]> granicus.if.org Git - php/commitdiff
MFH: String offset starts with 0
authorMarcus Boerger <helly@php.net>
Sun, 29 Aug 2004 19:15:57 +0000 (19:15 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 29 Aug 2004 19:15:57 +0000 (19:15 +0000)
Zend/zend_execute.c

index a52dac0904d322037a656325cbbb8b240d51d4c4..9103400fb84ee1b7478ac51b086b816858df0e4b 100644 (file)
@@ -4032,12 +4032,12 @@ static int zend_isset_isempty_dim_prop_obj_handler(int prop_dim, ZEND_OPCODE_HAN
                } else if ((*container)->type == IS_STRING) { /* string offsets */
                        switch (opline->extended_value) {
                                case ZEND_ISSET:
-                                       if (offset->value.lval <= Z_STRLEN_PP(container)) {
+                                       if (offset->value.lval < Z_STRLEN_PP(container)) {
                                                result = 1;
                                        }
                                        break;
                                case ZEND_ISEMPTY:
-                                       if (offset->value.lval <= Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
+                                       if (offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
                                                result = 1;
                                        }
                                        break;