We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b706935 commit 6354dd7Copy full SHA for 6354dd7
jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c
@@ -930,7 +930,8 @@ ecma_builtin_replace_substitute (ecma_replace_context_t *ctx_p) /**< replace con
930
931
JERRY_ASSERT (ecma_is_value_string (match_value));
932
const ecma_string_t *const matched_p = ecma_get_string_from_value (match_value);
933
- const lit_utf8_size_t match_size = ecma_string_get_size (matched_p);
+ const lit_utf8_size_t match_size_raw = ecma_string_get_size(matched_p);
934
+ const lit_utf8_size_t match_size = JERRY_MIN(match_size_raw, ctx_p->string_size);
935
const lit_utf8_byte_t *const begin_p = ctx_p->string_p + ctx_p->match_byte_pos + match_size;
936
937
ecma_stringbuilder_append_raw (&(ctx_p->builder),
0 commit comments