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

Deno.Buffer.readFrom(Sync) methods void exceptions #5591

Closed
SyrupThinker opened this issue May 18, 2020 · 2 comments · Fixed by #6161
Closed

Deno.Buffer.readFrom(Sync) methods void exceptions #5591

SyrupThinker opened this issue May 18, 2020 · 2 comments · Fixed by #6161
Labels
bug Something isn't working correctly

Comments

@SyrupThinker
Copy link
Contributor

deno/cli/js/buffer.ts

Lines 180 to 192 in 93c2164

try {
const i = this.#grow(MIN_READ);
this.#reslice(i);
const fub = new Uint8Array(this.#buf.buffer, i);
const nread = r.readSync(fub);
if (nread === null) {
return n;
}
this.#reslice(i + nread);
n += nread;
} catch (e) {
return n;
}

This masks failures in read functions and can manifest like in #4789 where an empty buffer is returned instead.

deno 1.0.0
v8 8.4.300
typescript 3.9.2
(master build)
@bartlomieju bartlomieju added bug Something isn't working correctly std labels May 18, 2020
@caspervonb
Copy link
Contributor

caspervonb commented Jun 7, 2020

Anyone working on this? If not I'll take it on as it relates to #6121 which I'm working on

@bartlomieju
Copy link
Member

bartlomieju commented Jun 7, 2020

@caspervonb go ahead, this issue hasn't been claimed yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants