Skip to content

Conversation

@jiangzidong
Copy link
Contributor

Str_len can smaller than buffer_size.

  if (ecma_string_get_size (str_p) > buffer_size)
  {
    return 0;
  }

It should be ">" in the comparison.

And also change the related code in unit-test-api.c.
Before, in the foreach, it only sunk into

  if (sz == 0)
  {
    JERRY_ASSERT (!strncmp ((const char *) user_data, "user_data", 9));
    return true;
  }

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com

@zherczeg
Copy link
Member

LGTM

@LaszloLango LaszloLango added bug Undesired behaviour api Related to the public API labels Jul 15, 2016
@LaszloLango LaszloLango added this to the Release v1.0 milestone Jul 15, 2016
@LaszloLango
Copy link
Contributor

LGTM

@LaszloLango
Copy link
Contributor

@jiangzidong, please rebase to the current master, so we can land it properly.

@LaszloLango LaszloLango merged commit 6084f08 into jerryscript-project:master Jul 15, 2016
str_len can smaller than buffer_size.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Related to the public API bug Undesired behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants