Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Espruino \0 in object keys #2176

Closed
gfwilliams opened this issue Mar 31, 2022 · 0 comments
Closed

Espruino \0 in object keys #2176

gfwilliams opened this issue Mar 31, 2022 · 0 comments

Comments

@gfwilliams
Copy link
Member

Something is very wrong here and I'm surprised it hasn't been hit before:

>a = { "" : {} }
={ 
  "": {  }
 }
>a["\x00abc"] = "foo"
="foo"
>a[" \x00abc"] = "bar"
="bar"
={ 
  "": "foo", 
  " \0abc": "bar"
 }
>
>a
={ 
  "": "foo", 
  " \0abc": "bar"
 }

I believe the search for object keys is being done with zero-terminated strings, which is causing all kinds of issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant