Limit the constructed string size in String.prototype.repeat (#3066)

This patch fixes #3063.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-09-07 12:20:57 +02:00
committed by Dániel Bátyai
parent 1b84a17dc7
commit 91818bea93
3 changed files with 33 additions and 0 deletions
+5
View File
@@ -1348,6 +1348,11 @@ typedef enum
#define ECMA_GET_DIRECT_STRING_VALUE(string_p) \
(((uintptr_t) (string_p)) >> ECMA_DIRECT_STRING_SHIFT)
/**
* Maximum number of bytes that a long-utf8-string is able to store
*/
#define ECMA_STRING_SIZE_LIMIT UINT32_MAX
typedef enum
{
ECMA_STRING_CONTAINER_HEAP_UTF8_STRING, /**< actual data is on the heap as an utf-8 (cesu8) string