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

bug fixed in read_to_buffer #32457

Merged
merged 4 commits into from
Jul 3, 2019
Merged

Conversation

jsulmont
Copy link
Contributor

@jsulmont jsulmont commented Jun 30, 2019

fixed a bug in buffer.jl triggered when read_to_buffer is called on a non empty buffer.
This is related to #32397.

@jsulmont jsulmont changed the title WIP bug fixed in read_to_buffer #32397 WIP bug fixed in read_to_buffer Jun 30, 2019
@bicycle1885
Copy link
Member

Looks good to me if you add tests.

@jsulmont jsulmont changed the title WIP bug fixed in read_to_buffer bug fixed in read_to_buffer Jun 30, 2019
@jsulmont
Copy link
Contributor Author

jsulmont commented Jul 1, 2019

Looks good to me if you add tests.

@bicycle1885 I've added a few tests

@JeffBezanson JeffBezanson added bugfix This change fixes an existing bug stdlib Julia's standard library labels Jul 1, 2019
@jsulmont
Copy link
Contributor Author

jsulmont commented Jul 2, 2019

Hi @JeffBezanson @bicycle1885 -- any feedback? Am I missing anything?
As I said, this can only happens when read_to_buffer is called when buffer.size > 0, which implies:

  1. it is called more than once, which means the size of the encoded input is greater than 512, and,
  2. since encoded characters are consumed by 4 (multiple of 512), some input has been discarded (because not in the encoding table) causing read_to_buffer to be called again (possibly with buffer.size > 0).

IMO using code coverage might have revealed that the existing tests weren't triggering that part of the code.

@bicycle1885
Copy link
Member

This looks good to me now But since I have no permission to merge, we need to ask someone else to merge.

@KristofferC KristofferC merged commit 4b6ab68 into JuliaLang:master Jul 3, 2019
@jsulmont jsulmont deleted the js/base64decode-bug branch July 3, 2019 06:48
KristofferC pushed a commit that referenced this pull request Jul 8, 2019
* bug fixed in read_to_buffer

* added test for #32397.

* switch back to original case

* added torture test for long encoded string randomly laced with spaced

(cherry picked from commit 4b6ab68)
@KristofferC KristofferC mentioned this pull request Jul 8, 2019
32 tasks
KristofferC pushed a commit that referenced this pull request Aug 26, 2019
* bug fixed in read_to_buffer

* added test for #32397.

* switch back to original case

* added torture test for long encoded string randomly laced with spaced

(cherry picked from commit 4b6ab68)
@KristofferC KristofferC mentioned this pull request Aug 26, 2019
55 tasks
KristofferC pushed a commit that referenced this pull request Aug 26, 2019
* bug fixed in read_to_buffer

* added test for #32397.

* switch back to original case

* added torture test for long encoded string randomly laced with spaced

(cherry picked from commit 4b6ab68)
KristofferC pushed a commit that referenced this pull request Feb 20, 2020
* bug fixed in read_to_buffer

* added test for #32397.

* switch back to original case

* added torture test for long encoded string randomly laced with spaced

(cherry picked from commit 4b6ab68)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug stdlib Julia's standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants