diff options
| -rwxr-xr-x | ext/intl/grapheme/grapheme_util.h | 2 | ||||
| -rw-r--r-- | ext/intl/tests/bug61487.phpt | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/ext/intl/grapheme/grapheme_util.h b/ext/intl/grapheme/grapheme_util.h index 675c6481b7..c91aeaff7d 100755 --- a/ext/intl/grapheme/grapheme_util.h +++ b/ext/intl/grapheme/grapheme_util.h @@ -54,6 +54,6 @@ UBreakIterator* grapheme_get_break_iterator(void *stack_buffer, UErrorCode *status TSRMLS_DC ); /* OUTSIDE_STRING: check if (possibly negative) long offset is outside the string with int32_t length */ -#define OUTSIDE_STRING(offset, max_len) ( offset < INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (long) max_len : offset >= (long) max_len) ) +#define OUTSIDE_STRING(offset, max_len) ( offset <= INT32_MIN || offset > INT32_MAX || (offset < 0 ? -offset > (long) max_len : offset >= (long) max_len) ) #endif // GRAPHEME_GRAPHEME_UTIL_H diff --git a/ext/intl/tests/bug61487.phpt b/ext/intl/tests/bug61487.phpt new file mode 100644 index 0000000000..361debe408 --- /dev/null +++ b/ext/intl/tests/bug61487.phpt @@ -0,0 +1,11 @@ +--TEST-- +grapheme() str[i]pos limits +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php +var_dump(grapheme_stripos(1,1,2147483648)); +var_dump(grapheme_strpos(1,1,2147483648)); +--EXPECT-- +bool(false) +bool(false) |
