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

Fix various base64_decode bugs. #1923

Closed
wants to merge 6 commits into from

Commits on May 25, 2016

  1. Copy the full SHA
    505469f View commit details
    Browse the repository at this point in the history
  2. base64_decode: remove redundant check

    If length == 0 || *current != '=' is false, the for loop will always
    end up in this same point, until the if statement becomes true.
    Thus, the if statement is not needed.
    Metabolix committed May 25, 2016
    Copy the full SHA
    637c567 View commit details
    Browse the repository at this point in the history
  3. base64_decode: fix bug #72152 (fail on NUL bytes in strict mode)

    This added check is actually for NOT failing in NON-strict mode.
    The ch == -2 check later causes the desired failure in strict mode.
    Metabolix committed May 25, 2016
    Copy the full SHA
    0893bf1 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    8f3cb42 View commit details
    Browse the repository at this point in the history
  5. base64_decode: remove redundant code

    case 1 is already handled in the first lines of the for loop;
    it would only be entered in the invalid case where the string
    continues past the defined length (ch != 0 but length-- == 0).
    
    case 2 and case 3 are redundant, since k >= j and later the
    string is truncated to j characters anyway.
    Metabolix committed May 25, 2016
    Copy the full SHA
    12bc5cc View commit details
    Browse the repository at this point in the history
  6. Copy the full SHA
    1d3b16d View commit details
    Browse the repository at this point in the history