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

Stack overflow in shaka.util.StringUtils.fromUTF8 #335

Closed
SomeJSGuy opened this issue Apr 14, 2016 · 1 comment
Closed

Stack overflow in shaka.util.StringUtils.fromUTF8 #335

SomeJSGuy opened this issue Apr 14, 2016 · 1 comment
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@SomeJSGuy
Copy link

I'm having a stack overflow when parsing a large mpd because of the use of String.fromCharCode in /lib/util/string_utils.js, in lnie 39:

var utf8 = String.fromCharCode.apply(null, new Uint8Array(data));

Here are a few related cases I have found:

manuels/texlive.js#18
https://bugs.webkit.org/show_bug.cgi?id=80797

Also, in MDN it states that for higher values, it would be better to use String.fromCodePoint() than fromCharCode: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode.

@joeyparrish joeyparrish added the type: bug Something isn't working correctly label Apr 14, 2016
@joeyparrish joeyparrish added this to the v2.0.0 milestone Apr 14, 2016
@joeyparrish
Copy link
Member

Should be an easy fix to just loop instead of using fromCharCode.apply.

I'm not sure I understand your point about fromCodePoint(), though. The values in a Uint8Array are not large enough for that to be necessary.

@TheModMaker TheModMaker self-assigned this Apr 15, 2016
@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

4 participants