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

ensure we are not leaking buffer details from iconv-lite-umd for #79275 #100541

Closed
wants to merge 1 commit into from
Closed

ensure we are not leaking buffer details from iconv-lite-umd for #79275 #100541

wants to merge 1 commit into from

Conversation

gyzerok
Copy link
Contributor

@gyzerok gyzerok commented Jun 19, 2020

As we discussed in the issue we do not want to leak any Buffer shim details. They are not leaking already, however we can also make it very explicit.

@gyzerok gyzerok changed the title ensure we are not leaking buffer details form iconv-lite-umd for #79275 ensure we are not leaking buffer details from iconv-lite-umd for #79275 Jun 19, 2020
@bpasero bpasero self-assigned this Jun 19, 2020
@bpasero bpasero added this to the June 2020 milestone Jun 19, 2020
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, not entirely sure this is needed, but it is also not causing any harm.

@bpasero bpasero self-requested a review June 19, 2020 07:02
Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, what about the direct use of Buffer.from? This is a pre-req for #100539 I would argue.

@gyzerok
Copy link
Contributor Author

gyzerok commented Jun 19, 2020

@bpasero what do you mean by direct use of Buffer.from?

@bpasero
Copy link
Member

bpasero commented Jun 19, 2020

@gyzerok referring to this:

const decoded = decoder.write(Buffer.from(VSBuffer.concat(bufferedChunks).buffer));

target.write(decoder.write(Buffer.from(chunk.buffer)));

const guessed = jschardet.detect(Buffer.from(buffer.slice(0, AUTO_ENCODING_GUESS_MAX_BYTES).buffer)); // ensure to limit buffer for guessing due to https://github.com/aadsm/jschardet/issues/53

My understanding is that we need to change to Uint8Array before we can move this to common because Buffer is not available in web environments.

@gyzerok
Copy link
Contributor Author

gyzerok commented Jun 19, 2020

@bpasero ohh, that's a major oversight 😅 I will close this PR then and will fix it in another one. Thank you for pointing that out!

@gyzerok gyzerok closed this Jun 19, 2020
@gyzerok gyzerok deleted the avoid-leaking-buffer-shim branch June 19, 2020 07:15
@github-actions github-actions bot locked and limited conversation to collaborators Aug 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants