Add warn_unused_result attribute to ecma_string_to_utf8_string. Add assertions that specified buffer size is sufficient in places, where return value of ecma_string_to_utf8_string wasn't checked prior to the changes.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
@@ -836,7 +836,9 @@ ecma_builtin_json_parse (ecma_value_t this_arg __attr_unused___, /**< 'this' arg
|
||||
|
||||
MEM_DEFINE_LOCAL_ARRAY (str_start_p, buffer_size, lit_utf8_byte_t);
|
||||
|
||||
ecma_string_to_utf8_string (string_p, str_start_p, (ssize_t) buffer_size);
|
||||
ssize_t sz = ecma_string_to_utf8_string (string_p, str_start_p, (ssize_t) buffer_size);
|
||||
JERRY_ASSERT (sz == (ssize_t) string_size);
|
||||
|
||||
str_start_p[string_size] = LIT_BYTE_NULL;
|
||||
|
||||
ecma_json_token_t token;
|
||||
|
||||
Reference in New Issue
Block a user